Hi everyone,
I am trying to extract data from a website using VBA. This is the web site:
Burberry Men Burberry cologne - a fragrance for men 1995
The result that I need is "3.94" which is in the line "Perfume rating: 3.94 out of 5 with 868 votes." on the website.
This is the code in VBA I am currently using (based on research here an on YouTube) but with no success as I am very new to web scrapping (I have entered the web site in Range("K1") below):
Sub Extract()
Application.ScreenUpdating = False
Dim IE As New InternetExplorer
'IE.Visible = True
IE.Navigate Sheet1.Range("K1").Value
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc = IE.document
Dim Extract As String
Extract = Doc.getElementsByTagName("span")(o).innerText
Range("A1").Value = Extract
Application.ScreenUpdating = True
End Sub
I am trying to extract data from a website using VBA. This is the web site:
Burberry Men Burberry cologne - a fragrance for men 1995
The result that I need is "3.94" which is in the line "Perfume rating: 3.94 out of 5 with 868 votes." on the website.
This is the code in VBA I am currently using (based on research here an on YouTube) but with no success as I am very new to web scrapping (I have entered the web site in Range("K1") below):
Sub Extract()
Application.ScreenUpdating = False
Dim IE As New InternetExplorer
'IE.Visible = True
IE.Navigate Sheet1.Range("K1").Value
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
Dim Doc As HTMLDocument
Set Doc = IE.document
Dim Extract As String
Extract = Doc.getElementsByTagName("span")(o).innerText
Range("A1").Value = Extract
Application.ScreenUpdating = True
End Sub