Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 14243

WebScraping Company Names with BeautifulSoup

$
0
0

I'm trying to pull the company names from a website and have not been able to produce anything. I'm not sure if I'm selecting the wrong class or what I'm doing wrong.

Site: https://wineparis-vinexpo.com/newfront/search/exhibitors

It is the companies under the "Exhibitors" section. The first company on the list would be "0.0% Sober Spirits" and then "1884 Dumangin J. Fils" and so on.

import requestsfrom bs4 import BeautifulSoupURL = "https://wineparis-vinexpo.com/newfront/search/exhibitors"page = requests.post(URL)soup = BeautifulSoup(page.content, "html.parser")results = soup.find(id="__next")ex_elements = results.find_all("div", class_="MuiBox-root css-k008qs")for ex_element in ex_elements:    company = ex_element.find("div", class_="MuiBox-root css-k008qs")    print(company.text.strip())    print()

Also, the list goes over multiply pages, but I haven't tackled that yet.

Any help would be greatly appreciated.


Viewing all articles
Browse latest Browse all 14243

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>