VBA/Data Scraping - Pulling (Today's) Bond Rates Into Excel

Vexorg

Board Regular
Joined
Oct 5, 2010
Messages
116
Hello,

I am trying to pull current market data (bond rates) into excel from the below link:

https://rates.chathamfinancial.com/us-market/rates

In short, I am trying to pull the rates for each respective term in the 'Current' column as per the highlighted below. I have been able to do this using excel's data scraper tool and using vlookups but I am pretty sure there is a better way (more accurate/consistent) to do this via VBA.


<header _ngcontent-c7="" class="rates-table__header" style="font-family: "PT Sans", Helvetica, Arial, sans-serif; box-sizing: border-box; display: flex; place-content: center; flex-direction: column; height: 30px; width: 606px; padding-left: 10px; margin: 0px; background-color: rgb(126, 126, 126); color: rgb(65, 65, 65); font-size: 16px;">[h=1]US TREASURIES[/h]</header>[FONT=&quot][TABLE="class: rates-table__table ng-star-inserted, width: 606"]
<thead _ngcontent-c7="" style="box-sizing: border-box;">[TR]
[TH="class: label, align: left"] [/TH]
[TH="class: current, align: left"]Current[/TH]
[TH="align: left"]1 Day Ago[/TH]
[TH="align: left"]1 Mo. Ago[/TH]
[TH="align: left"]1 Year Ago[/TH]
[/TR]
</thead><tbody _ngcontent-c7="" class="ng-star-inserted" style="box-sizing: border-box; padding: 10px;">[TR]
[TD="class: label"]1 Year[/TD]
[TD="class: current"]2.620%[/TD]
[TD]2.645%[/TD]
[TD]2.572%[/TD]
[TD]1.417%[/TD]
[/TR]
[TR]
[TD="class: label"]2 Year[/TD]
[TD="class: current"]2.837%[/TD]
[TD]2.877%[/TD]
[TD]2.815%[/TD]
[TD]1.583%[/TD]
[/TR]
[TR]
[TD="class: label"]3 Year[/TD]
[TD="class: current"]2.890%[/TD]
[TD]2.954%[/TD]
[TD]2.898%[/TD]
[TD]1.727%[/TD]
[/TR]
[TR]
[TD="class: label"]5 Year[/TD]
[TD="class: current"]2.944%[/TD]
[TD]3.011%[/TD]
[TD]2.963%[/TD]
[TD]2.042%[/TD]
[/TR]
[TR]
[TD="class: label"]7 Year[/TD]
[TD="class: current"]3.031%[/TD]
[TD]3.099%[/TD]
[TD]3.041%[/TD]
[TD]2.256%[/TD]
[/TR]
[TR]
[TD="class: label"]10 Year[/TD]
[TD="class: current"]3.108%[/TD]
[TD]3.169%[/TD]
[TD]3.082%[/TD]
[TD]2.415%[/TD]
[/TR]
[TR="class: rates-table___row--hide-mobile"]
[TD="class: label"]15 Year[/TD]
[TD]–[/TD]
[TD]–[/TD]
[TD]–[/TD]
[TD]–[/TD]
[/TR]
[TR]
[TD="class: label"]30 Year[/TD]
[TD="class: current"]3.334%[/TD]
[TD]3.367%[/TD]
[TD]3.218%[/TD]
[TD]2.923%[/TD]
[/TR]
</tbody>[/TABLE]
[/FONT]

vu8NWzU

vu8NWzU


vu8NWzU
Any help would be appreciated!
 

Excel Facts

Test for Multiple Conditions in IF?
Use AND(test, test, test, test) or OR(test, test, test, ...) as the logical_test argument of IF.

Forum statistics

Threads
1,225,750
Messages
6,186,809
Members
453,374
Latest member
Descant40

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top