Skip to content
Advertisement

Scrape eBay Sold Items Using Selenium Returns []

I have almost no webscraping experience, and wasn’t able to solve this using BeautifulSoup, so I’m trying selenium (installed it today). I’m trying to scrape sold items on eBay. I’m trying to scrape:

https://www.ebay.com/sch/i.html?_from=R40&_nkw=oakley+sunglasses&_sacat=0&Brand=Oakley&rt=nc&LH_Sold=1&LH_Complete=1&_ipg=200&_oaa=1&_fsrp=1&_dcat=79720

Here is my code where I load in html code and convert to selenium html:

JavaScript

Which correctly opens a new chrome session at the correct url. I’m working on getting the titles, prices, and date sold and then loading it into a csv file. Here is the code I have for those:

JavaScript

Which just returns []. I think ebay may be blocking my IP, but the html code loads in and looks correct. Hopefully someone can help! Thanks!

Advertisement

Answer

You can use the below code to scrape the details. also you can use pandas to store data in csv file.

Code :

JavaScript

Imports :

JavaScript
User contributions licensed under: CC BY-SA
8 People found this is helpful
Advertisement