导入Beautiful Soup时出现此错误。from bs4 import BeautifulSoup Error
from bs4 import BeautifulSoup
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
from bs4 import BeautifulSoup
File "C:\Users\pood1\AppData\Local\Programs\Python\Python36\lib\site-packages\bs4\__init__.py", line 30, in <module>
from .builder import builder_registry, ParserRejectedMarkup
File "C:\Users\pood1\AppData\Local\Programs\Python\Python36\lib\site-packages\bs4\builder\__init__.py", line 308, in <module>
from . import _htmlparser
File "C:\Users\pood1\AppData\Local\Programs\Python\Python36\lib\site- packages\bs4\builder\_htmlparser.py", line 7, in <module>
from html.parser import (
ImportError: cannot import name 'HTMLParseError'
Python:3.6.1 , BeautifulSoup:4-4.3.2
我该如何解决这个问题?
可能重复的[在Python 3.5中导入bs4](https://stackoverflow.com/questions/28745153/importing-bs4-in-python-3-5 ) –
我解决了这个问题。谢谢。问题是我的Python版本。将版本更改为3.5.3后,此错误消失! –
如果您解决了该问题,请添加解决方案作为答案并将其标记为已接受。谢谢。 –