導入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後,此錯誤消失! –
如果您解決了該問題,請添加解決方案作爲答案並將其標記爲已接受。謝謝。 –