0
votes

I can import BeautifulSoup using Python 2.7 but not when I try using Python 3.6, even though BeautifulSoup claims to work on both?

Sorry this is my first question so apologies if it's trivial or if I haven't used the 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

1

1 Answers

0
votes

Just noticed - you're importing from BeautifulSoup. Try from bs4 import *