我正在尝试导入beautifulsoup但是当我运行脚本时出现错误:
Traceback (most recent call last):
File "LinkCrawler.py", line 5, in <module>
from bs4 import BeautifulSoup
File "/Users/ivanyurchenko/Documents/Projects/crawler/bs4/__init__.py", line 29, in <module>
from .builder import builder_registry
File "/Users/ivanyurchenko/Documents/Projects/crawler/bs4/builder/__init__.py", line 294, in <module>
from . import _htmlparser
File "/Users/ivanyurchenko/Documents/Projects/crawler/bs4/builder/_htmlparser.py", line 7, in <module>
from html.parser import (
ImportError: cannot import name 'HTMLParseError'
我试图安装/更新beautifulsoup包但没有快乐:
$ pip install --upgrade beautifulsoup4
Requirement already up-to-date: beautifulsoup4 in /Users/ivanyurchenko/anaconda/lib/python3.6/site-packages
$ python3 -m pip install -U beautifulsoup4
Requirement already up-to-date: beautifulsoup4 in /Users/ivanyurchenko/anaconda/lib/python3.6/site-packages
我对python不太熟悉。谁能告诉我我做错了什么?
UPD:我需要一个webcrawler,所以我在github上找到了一个示例项目,我现在正努力让它工作。您可以看到其代码here。