Hi Folks,
I have trying to extract the follow info from multiple websites into a singe table in Excel.
Website 1 : (Financial Futures – Investing.com UK) to extract the values under 'Last' column for all the bonds.
Website 2 : (COVID Live - Coronavirus Statistics - Worldometer) to extract Total cases, Total deaths and Recovered values for countries. For example: Vietnam, Sri Lanka and UK.
I am able to pull the data from the website. However, unable to do so from the 2nd Website. I have the below query and would seek guidance where I am going wrong. I am a newbie and intend to learn a lot and progress further. Any help would be great !
Private Sub CommandButton1_Click()
Set objIE = CreateObject("InternetExplorer.Application")
Dim request As Object
Dim website As String
objIE.Top = 0
objIE.Left = 0
objIE.Width = 800
objIE.Height = 600
objIE.Visible = True
objIE.Navigate ("Government Bonds – Investing.com UK")
Do
DoEvents
Loop Until objIE.readystate = 4
Range("B2").Value = (objIE.document.getElementsByClassName("pid-8907-last")(0).innerText)
objIE.Navigate ("COVID Live - Coronavirus Statistics - Worldometer")
Range("C2").Value = (font-weight: bold; text-align:right" class="sorting_1")(0).innerText)
End Sub
Thank you
I have trying to extract the follow info from multiple websites into a singe table in Excel.
Website 1 : (Financial Futures – Investing.com UK) to extract the values under 'Last' column for all the bonds.
Website 2 : (COVID Live - Coronavirus Statistics - Worldometer) to extract Total cases, Total deaths and Recovered values for countries. For example: Vietnam, Sri Lanka and UK.
I am able to pull the data from the website. However, unable to do so from the 2nd Website. I have the below query and would seek guidance where I am going wrong. I am a newbie and intend to learn a lot and progress further. Any help would be great !
Private Sub CommandButton1_Click()
Set objIE = CreateObject("InternetExplorer.Application")
Dim request As Object
Dim website As String
objIE.Top = 0
objIE.Left = 0
objIE.Width = 800
objIE.Height = 600
objIE.Visible = True
objIE.Navigate ("Government Bonds – Investing.com UK")
Do
DoEvents
Loop Until objIE.readystate = 4
Range("B2").Value = (objIE.document.getElementsByClassName("pid-8907-last")(0).innerText)
objIE.Navigate ("COVID Live - Coronavirus Statistics - Worldometer")
Range("C2").Value = (font-weight: bold; text-align:right" class="sorting_1")(0).innerText)
End Sub
Thank you