dimanche 18 avril 2021

Web Scraping data from elements of a certain class?

I am working on a personal project in which I am attempting to pull the Width, Height, and Depth information for various appliances from a Home Dpot Webpage such as this one:

https://www.homedepot.com/p/LG-Electronics-29-5-cu-ft-Smart-French-4-Door-Door-In-Door-Full-Convert-with-Craft-Ice-Refrigerator-in-PrintProof-Stainless-Steel-LRMDS3006S/312285857

The dimensions are about halfway down the page and look like this:

https://imgur.com/a/m0vwItx

I am having trouble scraping those values out of the page. I tried using the Div classes that they were under but they seem to describe the table cell dimensions and not specifically those values. If this is the case I can put them into lists/dicts and search for the ones I want, but I can't seem to scrape them at all. My current code looks like:

specList = soup.find_all("div", {"class": "specifications__row col__12-12 col__12-12--xs col__12-12--sm col__6-12--md"})
        print(specList)

Any ideas folks? I'm coming up dry online searching.

Mark




Aucun commentaire:

Enregistrer un commentaire