beautifulsoup - Python 3.6 Beautiful Soup - Attribute Error -


i can import beautifulsoup using python 2.7 not when try using python 3.6, though beautifulsoup claims work on both?

sorry first question apologies if it's trivial or if haven't used proper conventions.

from beautifulsoup import * traceback (most recent call last): file "", line 1, in file "/users/tobiecusson/desktop/python/ch3-pythonforwebdata/assignmentweek4/beautifulsoup.py", line 448 raise attributeerror, "'%s' object has no attribute '%s'" % (self.class.name, attr) ^ syntaxerror: invalid syntax

from bs4 import beautifulsoup traceback (most recent call last): file "", line 1, in file "/users/tobiecusson/desktop/python/ch3-pythonforwebdata/assignmentweek4/bs4.py", line 448 raise attributeerror, "'%s' object has no attribute '%s'" % (self.class.name, attr) ^ syntaxerror: invalid syntax

just noticed - you're importing beautifulsoup. try from bs4 import *


Comments

Popular posts from this blog

qt - QML MouseArea onWheel event not working properly when inside QML Scrollview -

java - is not an enclosing class / new Intent Cannot Resolve Constructor -

python - Error importing VideoFileClip from moviepy : AttributeError: 'PermissionError' object has no attribute 'message' -