【发布时间】:2018-01-01 00:40:15
【问题描述】:
我打算用 GUI 制作一个字典程序,但我遇到了第一个障碍。我刚刚安装了一个模块 (PyDictionary),但是当我运行以下代码时出现错误。
from PyDictionary import PyDictionary
dictionary = PyDictionary()
print(dictionary.meaning("fish"))
返回
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']}
【问题讨论】:
-
PyDictionary 使用 BeautifulSoup,所以通过使用 PyDictionary,您实际上是在使用 BeautifulSoup。
-
看起来 PyDictionary 已经过时了,因为它利用了网络请求,并且使用了旧的 HTML 解析器。
标签: python python-3.x beautifulsoup