Can anyone explain to me why am I getting this error message? I have the exact same code in another project but after creating a new venv and install requests, bs4 and html.parser I get this message. I don't understand, at all.
import requests
import bs4 as BeautifulSoup
import html.parser
source = requests.get('https://docs.python.org/3/library/html.parser.html')
soup = BeautifulSoup(source.text, 'html.parser')
print(soup)
It looks like you just need to change your bs4 import. Try this:
To explain what was wrong, basically you were importing the entire bs4 module in as BeautifulSoup, when you actually wanted to import the BeautifulSoup class from the bs4 module.