Greetings,I have Python 2.7 and have installed Beautiful Soupthe "from bs4 import BeautifulSoup" worksI have created (copied and pasted) the html_doc from the documentation.When I execute "soup = BeautifulSoup(html_doc) I get "Traceback (most recent call last):
File "<pyshell#5>", line 1, in <module>
soup = BeautifulSoup(htmldoc2)
NameError: name 'htmldoc2' is not defined"help?Thanks
Never mind – for completeness, let me explain in case it helps somebody.
This line (from the documentation: http://www.crummy.com/software/BeautifulSoup/bs4/doc/#name ) gives the error:
soup = BeautifulSoup(html_doc)
This Line works:
soup = BeautifulSoup (open("html_doc.html"))
I found the “open” syntax searching around.
-Sparky