SOLVED

Trying to scrap lists from Ebay website but unable to do that

Copper Contributor

I have been trying to download these below lists from the ebay webiste.

Column 1: Item name
Column 2: item price
Column 3: Shipping price

But i am new to VBA and all i did and make is below code so far.

can someone please help me with this that how to scrap the required data from below link

    Sub Web_Scraping()

  Dim Internet_Explorer As InternetExplorer
  Set Internet_Explorer = New InternetExplorer
  Internet_Explorer.Visible = True
  Internet_Explorer.navigate ("https://www.ebay.com/sch/i.html?_nkw=045496902612+-Disc+-Only+-Refurbished+-Used+-Lot+-Import+-Japan+-Repro+-Reproduction+-Replacement+-VGA+-Graded+-Edition+-Edtion+-EU+-Mod+-Mods+-Moded+-modded+-Digital+-Collection+-Bundle+-Code+-Codes&LH_TitleDesc=0&LH_BIN=1&LH_Sold=1&rt=nc&LH_PrefLoc=1&LH_ItemCondition=3")
Do While Internet_Explorer.readyState <> READYSTATE_COMPLETE: Loop
  MsgBox Internet_Explorer.LocationName & vbNewLine & vbNewLine & Internet_Explorer.LocationURL
  
  
  
  For Each item In respJSON("QuickQuoteResult")("QuickQuote")
    ThisWorkbook.Worksheets(1).Cells(i, "A") = item("Item name")
    ThisWorkbook.Worksheets(1).Cells(i, "B") = item("item price")
    ThisWorkbook.Worksheets(1).Cells(i, "C") = item("Shipping price")
  
End Sub


2 Replies
best response confirmed by excelongoing (Copper Contributor)
Solution

@excelongoing 

 

I don't know much about web scraping, but perhaps this will help:

 

https://www.youtube.com/watch?v=dShR33CdlY8&ab_channel=WiseOwlTutorials

 

Also, see attached workbook. It appears to work with the specific link you provided. I'm not sure if it will work for all ebay searches, but you could play with it and hopefully it will be helpful.

 

Note that the workbook has references to the HTML and XML libraries (Tools/References).

JMB17_0-1611810951616.png

 

Thank you so much for the help and i will learn by the link you provided for sure that how to scrapping.
1 best response

Accepted Solutions
best response confirmed by excelongoing (Copper Contributor)
Solution

@excelongoing 

 

I don't know much about web scraping, but perhaps this will help:

 

https://www.youtube.com/watch?v=dShR33CdlY8&ab_channel=WiseOwlTutorials

 

Also, see attached workbook. It appears to work with the specific link you provided. I'm not sure if it will work for all ebay searches, but you could play with it and hopefully it will be helpful.

 

Note that the workbook has references to the HTML and XML libraries (Tools/References).

JMB17_0-1611810951616.png

 

View solution in original post