Skip to content Skip to sidebar Skip to footer

Importerror: Cannot Import Name 'beautifulsoup4'

I know this question has been asked a lot on this site, but I have tried all of the solutions given, and I cannot figure out how to solve this problem. For starters: I am on a Wind

Solution 1:

As @Blender mentioned is just BeautifulSoup:

from bs4 import BeautifulSoup

html = '''<a href="some_url">next</a>
<span class="class"><a href="another_url">later</a></span>'''

soup = BeautifulSoup(html)

for a in soup.find_all('a', href=True):
    print("Found the URL:", a['href'])

Output

Found the URL:some_urlFound the URL:another_url

The above code was taken as example from this question

Post a Comment for "Importerror: Cannot Import Name 'beautifulsoup4'"