【发布时间】:2017-12-05 19:31:05
【问题描述】:
我可以使用 Python 2.7 导入 BeautifulSoup,但当我尝试使用 Python 3.6 时却不能,即使 BeautifulSoup 声称两者都适用?
抱歉,这是我的第一个问题,如果它是微不足道的,或者我没有使用正确的约定,敬请见谅。
从 BeautifulSoup 导入 * 回溯(最近一次通话最后): 文件“”,第 1 行,在 文件“/Users/tobiecusson/Desktop/Python/Ch3-PythonForWebData/AssignmentWeek4/BeautifulSoup.py”,第 448 行 raise AttributeError, "'%s' object has no attribute '%s'" % (self.class.name, attr) ^ SyntaxError: 无效语法
从 BS4 导入 BeautifulSoup 回溯(最近一次通话最后): 文件“”,第 1 行,在 文件“/Users/tobiecusson/Desktop/Python/Ch3-PythonForWebData/AssignmentWeek4/BS4.py”,第 448 行 raise AttributeError, "'%s' object has no attribute '%s'" % (self.class.name, attr) ^ SyntaxError: 无效语法
【问题讨论】: