SOLVED

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

%3CLINGO-SUB%20id%3D%22lingo-sub-2102655%22%20slang%3D%22en-US%22%3ETrying%20to%20scrap%20lists%20from%20Ebay%20website%20but%20unable%20to%20do%20that%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2102655%22%20slang%3D%22en-US%22%3E%3CP%3EI%20have%20been%20trying%20to%20download%20these%20below%20lists%20from%20the%20ebay%20webiste.%3C%2FP%3E%3CPRE%3EColumn%20%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E%3A%20Item%20name%0AColumn%20%3CSPAN%20class%3D%22hljs-number%22%3E2%3C%2FSPAN%3E%3A%20item%20price%0AColumn%20%3CSPAN%20class%3D%22hljs-number%22%3E3%3C%2FSPAN%3E%3A%20Shipping%20price%3C%2FPRE%3E%3CP%3EBut%20i%20am%20new%20to%20VBA%20and%20all%20i%20did%20and%20make%20is%20below%20code%20so%20far.%3C%2FP%3E%3CP%3Ecan%20someone%20please%20help%20me%20with%20this%20that%20how%20to%20scrap%20the%20required%20data%20from%20below%20link%3C%2FP%3E%3CPRE%3E%20%20%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3ESub%3C%2FSPAN%3E%20Web_Scraping()%0A%0A%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3EDim%3C%2FSPAN%3E%20Internet_Explorer%20%3CSPAN%20class%3D%22hljs-keyword%22%3EAs%3C%2FSPAN%3E%20InternetExplorer%0A%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3ESet%3C%2FSPAN%3E%20Internet_Explorer%20%3D%20%3CSPAN%20class%3D%22hljs-keyword%22%3ENew%3C%2FSPAN%3E%20InternetExplorer%0A%20%20Internet_Explorer.Visible%20%3D%20%3CSPAN%20class%3D%22hljs-literal%22%3ETrue%3C%2FSPAN%3E%0A%20%20Internet_Explorer.navigate%20(%3CSPAN%20class%3D%22hljs-string%22%3E%22https%3A%2F%2Fwww.ebay.com%2Fsch%2Fi.html%3F_nkw%3D045496902612%2B-Disc%2B-Only%2B-Refurbished%2B-Used%2B-Lot%2B-Import%2B-Japan%2B-Repro%2B-Reproduction%2B-Replacement%2B-VGA%2B-Graded%2B-Edition%2B-Edtion%2B-EU%2B-Mod%2B-Mods%2B-Moded%2B-modded%2B-Digital%2B-Collection%2B-Bundle%2B-Code%2B-Codes%26amp%3BLH_TitleDesc%3D0%26amp%3BLH_BIN%3D1%26amp%3BLH_Sold%3D1%26amp%3Brt%3Dnc%26amp%3BLH_PrefLoc%3D1%26amp%3BLH_ItemCondition%3D3%22%3C%2FSPAN%3E)%0A%3CSPAN%20class%3D%22hljs-keyword%22%3EDo%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3EWhile%3C%2FSPAN%3E%20Internet_Explorer.readyState%20%26lt%3B%26gt%3B%20READYSTATE_COMPLETE%3A%20%3CSPAN%20class%3D%22hljs-keyword%22%3ELoop%3C%2FSPAN%3E%0A%20%20MsgBox%20Internet_Explorer.LocationName%20%26amp%3B%20vbNewLine%20%26amp%3B%20vbNewLine%20%26amp%3B%20Internet_Explorer.LocationURL%0A%20%20%0A%20%20%0A%20%20%0A%20%20%3CSPAN%20class%3D%22hljs-keyword%22%3EFor%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3EEach%3C%2FSPAN%3E%20item%20%3CSPAN%20class%3D%22hljs-keyword%22%3EIn%3C%2FSPAN%3E%20respJSON(%3CSPAN%20class%3D%22hljs-string%22%3E%22QuickQuoteResult%22%3C%2FSPAN%3E)(%3CSPAN%20class%3D%22hljs-string%22%3E%22QuickQuote%22%3C%2FSPAN%3E)%0A%20%20%20%20ThisWorkbook.Worksheets(%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E).Cells(i%2C%20%3CSPAN%20class%3D%22hljs-string%22%3E%22A%22%3C%2FSPAN%3E)%20%3D%20item(%3CSPAN%20class%3D%22hljs-string%22%3E%22Item%20name%22%3C%2FSPAN%3E)%0A%20%20%20%20ThisWorkbook.Worksheets(%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E).Cells(i%2C%20%3CSPAN%20class%3D%22hljs-string%22%3E%22B%22%3C%2FSPAN%3E)%20%3D%20item(%3CSPAN%20class%3D%22hljs-string%22%3E%22item%20price%22%3C%2FSPAN%3E)%0A%20%20%20%20ThisWorkbook.Worksheets(%3CSPAN%20class%3D%22hljs-number%22%3E1%3C%2FSPAN%3E).Cells(i%2C%20%3CSPAN%20class%3D%22hljs-string%22%3E%22C%22%3C%2FSPAN%3E)%20%3D%20item(%3CSPAN%20class%3D%22hljs-string%22%3E%22Shipping%20price%22%3C%2FSPAN%3E)%0A%20%20%0A%3CSPAN%20class%3D%22hljs-keyword%22%3EEnd%3C%2FSPAN%3E%20%3CSPAN%20class%3D%22hljs-keyword%22%3ESub%3C%2FSPAN%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3CBR%20%2F%3E%3C%2FPRE%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-2102655%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EExcel%3C%2FLINGO-LABEL%3E%3CLINGO-LABEL%3EMacros%20and%20VBA%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2104745%22%20slang%3D%22en-US%22%3ERe%3A%20Trying%20to%20scrap%20lists%20from%20Ebay%20website%20but%20unable%20to%20do%20that%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2104745%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F944945%22%20target%3D%22_blank%22%3E%40excelongoing%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EI%20don't%20know%20much%20about%20web%20scraping%2C%20but%20perhaps%20this%20will%20help%3A%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdShR33CdlY8%26amp%3Bab_channel%3DWiseOwlTutorials%22%20target%3D%22_blank%22%20rel%3D%22nofollow%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdShR33CdlY8%26amp%3Bab_channel%3DWiseOwlTutorials%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAlso%2C%20see%20attached%20workbook.%20It%20appears%20to%20work%20with%20the%20specific%20link%20you%20provided.%20I'm%20not%20sure%20if%20it%20will%20work%20for%20all%20ebay%20searches%2C%20but%20you%20could%20play%20with%20it%20and%20hopefully%20it%20will%20be%20helpful.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-2105406%22%20slang%3D%22en-US%22%3ERe%3A%20Trying%20to%20scrap%20lists%20from%20Ebay%20website%20but%20unable%20to%20do%20that%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-2105406%22%20slang%3D%22en-US%22%3EThank%20you%20so%20much%20for%20the%20help%20and%20i%20will%20learn%20by%20the%20link%20you%20provided%20for%20sure%20that%20how%20to%20scrapping.%3C%2FLINGO-BODY%3E
New 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 (New 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.