简体   繁体   中英

How to get rid of the BeautifulSoup html parser error when I'm not using BeautifulSoup

I'm going to be making a dictionary program with a GUI but I fell at the first hurdle. I just installed a module ( PyDictionary ) but when I run the following code I get an error.

from PyDictionary import PyDictionary
dictionary = PyDictionary()
print(dictionary.meaning("fish"))

Which returns

The code that caused this warning is on line 3 of the file Dictionary.py. To 
get rid of this warning, change code that looks like this:

 BeautifulSoup(YOUR_MARKUP})

to this:

 BeautifulSoup(YOUR_MARKUP, "lxml")

  markup_type=markup_type))
{'Noun': ['any of various mostly cold-blooded aquatic vertebrates usually having scales and breathing through gills', 'the flesh of fish used as food', '(astrology', 'the twelfth sign of the zodiac; the sun is in this sign from about February 19 to March 20'], 'Verb': ['seek indirectly', 'catch or try to catch fish or shellfish']}

It looks like this is a problem with PyDictionary, as noted here . The reason it is throwing a BeautifulSoup error is because PyDictionary is implemented using BeautifulSoup.

It looks like the issue may have been fixed, however. Did you install PyDictionary with pip? If so, try installing directly from the GitHub repo here .

Edit: I tested using the repo to install and the issue was resolved. I would advise you to do the same. If you're not sure how to do this feel free to ask.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM