I have been playing around with a scraper for consumer stocks and I can scrape data from the main page of items but once i start using the second, thid parges,
Sub asosdesc2()
Const READYSTATE_COMPLETE = 4
Dim j As Integer
Dim ie As InternetExplorer
Dim Doc As IHTMLDocument
Dim xcolElements As IHTMLElementCollection
Dim ell As IHTMLElement
Dim pn As Integer
j = 1
Set ie = CreateObject("InternetExplorer.Application")
For pn = 1 To 1
ie.Visible = False
ie.Navigate "http://www.asos.com/Men/Sale/Accessories/Cat/pgecategory.aspx?cid=2097&CTARef=shop|sale|cat|accessories#parentID=-1&pge=0&pgeSize=36&sort=-1"
Do
DoEvents
Loop Until Not ie.Busy And ie.readyState = READYSTATE_COMPLETE
Set Doc = ie.Document
'Set xcolElements = Doc.getElementsByClassName("description")
'Here lies the problem. Description works perflectly, price doesn't
Set xcolElements = Doc.getElementsByClassName("desc")
For Each ell In xcolElements
On Error GoTo Skip
Range("B" & j).Value = ell.innerText
j = j + 1
Skip:
Next ell
On Error GoTo 0
Next pn
ie.Quit
Set el = Nothing
Set xcolElements = Nothing
Set Doc = Nothing
Set ie = Nothing
End Sub
I am trying to return the description, the price and the HREF code to identify the item