所以我想了解网页解析,我是初学者。我已经安装了漂亮的汤,以下是我的代码
import bs4 as bs
import urllib.request
source_code = urllib.request.urlopen('https://pythonprogramming.net/parsememcparseface/').read()
soup = bs.Beautifulsoup(source_code, 'lxml')
print(soup)
然而,当我运行这个时,我收到了一个错误
File "C:\Users\my dell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bs4\__init__.py", line 30, in <module>
from .builder import builder_registry
File "C:\Users\my dell\AppData\Local\Programs\Python\Python36-32\lib\site-packages\bs4\builder\__init__.py", line 7, in <module>
from bs4.element import (
ImportError: cannot import name 'CharsetMetaAttributeValue'