这段代码:
from bs4 import BeautifulSoup
不起作用,并给出此错误:
raise AttributeError, "'%s' object has no attribute '%s'" % (self.__class__.__name__,attr)
^
SyntaxError: invalid syntax
我该怎么办 ?
您应该使用pip
安装程序,因此只需执行
pip install beautifulsoup4
那将安装最新的BS4,从2013-08-15开始为4.3.1。它支持Python 3。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句