import bs4 as bs
import urllib.request
site = urllib.request.urlopen('https://pythonprogramming.net/parsememcparseface/').read()
soup = bs.BeautifulSoup(site,'lxml')
print(soup)
这是我要运行的代码,得到的错误是:
Traceback (most recent call last):
File "C:/Users/rach/AppData/Local/Programs/Python/Python37/test.py", line 1, in <module>
import bs4 as bs
File "C:/Users/rach/AppData/Local/Programs/Python/Python37\bs4.py", line 6, in <module>
soup = bs.BeautifulSoup(sauce, 'lxml')
AttributeError: module 'bs4' has no attribute 'BeautifulSoup'
我已经安装了bs4和lxml。请帮忙。谢谢。