问题
I installed the 'wikipedia' module on my Windows 7 machine with pip install wikipedia
, but when I run this simple script:
import wikipedia
print (wikipedia.summary("Wikipedia"))
I get an error that says ImportError: cannot import name 'HTMLParseError'
. I'm using Python version 3.5 and the latest version of the wikipedia module. Is there another library that will give me this function?
回答1:
Reference to this
It's a bug in newer version of beutifulsoup, try doing this.
git clone https://github.com/jjangsangy/BeautifulSoup4 \
&& cd BeautifulSoup4 \
&& python3.5 setup.py install
来源:https://stackoverflow.com/questions/30215242/htmlparseerror-when-importing-wikipedia-module-in-python3