Hi All
Firstly, apologies I'm a bit a noobie to VBA coding.
Basically i'm attempting to do a little bit of "scraping" (if that's the correct term) I have a list of integers in column A and each refers to a specific webpage. There is data on each of these webpages I wish to extract. So far I have managed to write this code and it works to extract the data from one value in the list one at a time:
Dim IE As New InternetExplorer
'IE.Visible = True
IE.navigate "http://www.mywebsite.com/lookup?value=" & Range("Number").Value
Do
DoEvents
Loop Until IE.readyState = READYSTATE_COMPLETE
Dim doc As HTMLDocument
Set doc = IE.document
Dim sLcs As String
sLcs = Trim(doc.getElementsByTagName("span")(5).innerText)
Range("state").Value = sLcs
Now I have this working for one page, i'd like to run it so that is goes down through the list of values stored in column A and places the value "sLcs" in column B until the list reaches the end.
You help would be much appreciated.
Thanks!
Bookmarks