Beautiful soup error: soup = BeautifulSoup(html_doc, 'html ...
www.reddit.com › r › learnpythonNewish to python. I'm receiving this error: soup = BeautifulSoup (html_doc, 'html.parser') NameError: name 'html_doc' is not defined. for this simple code: # https://www.crummy.com/software/BeautifulSoup/bs4/doc/ from bs4 import BeautifulSoup soup = BeautifulSoup (html_doc, 'html.parser') The bs4 site says. If you get the ImportError “No module named html.parser”, your problem is that you’re running the Python 3 version of the code under Python.