YasserKhalil
Well-Known Member
Hello everyone
I have this code that scrapes ebay prices and lists
I would like to see 2 lists:
First list: Active Listings of items that are "US only", "New", "Buy it Now".
Second list: Sold items that are "US only", "New", "Buy it Now".
I have this code that scrapes ebay prices and lists
Code:
Sub WebScrapeEBay()
Dim doc As HTMLDocument
Dim ie As Object
Dim i As Integer
Dim i2 As Integer
Set ie = CreateObject("InternetExplorer.Application")
With ie
.Visible = False
For i2 = 0 To 0
.navigate "http://www.ebay.com/sch/i.html?_from=R40&_trksid=p2055845.m570.l1313.TR0.TRC0.H0.X" & Range("B4").Offset(0, (i2 * 2)).Value & ".TRS0&_nkw=" & Range("B4").Offset(0, (i2 * 2)).Value & "&_sacat=0"
Do
DoEvents
Loop Until ie.readyState = READYSTATE_COMPLETE
Set doc = ie.document
While ie.readyState <> 4
Wend
On Error Resume Next
For i = 0 To 500
Range("B7").Offset(i, (i2 * 2)).Value = doc.getElementById("ResultSetItems").getElementsByTagName("h3")(i).innerText
Range("B7").Offset(i, (i2 * 2) + 1).Value = doc.getElementById("ResultSetItems").getElementsByClassName("lvprice prc")(i).innerText
Next i
Next i2
ie.Quit
Application.EnableEvents = True
End With
MsgBox "Done...", 64
End Sub
I would like to see 2 lists:
First list: Active Listings of items that are "US only", "New", "Buy it Now".
Second list: Sold items that are "US only", "New", "Buy it Now".