Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 当I';我不使用BeautifulSoup_Python_Python 3.x_Beautifulsoup - Fatal编程技术网

Python 当I';我不使用BeautifulSoup

Python 当I';我不使用BeautifulSoup,python,python-3.x,beautifulsoup,Python,Python 3.x,Beautifulsoup,我打算用GUI制作一个字典程序,但我在第一个关口就失败了。我刚刚安装了一个模块(),但是当我运行下面的代码时,我得到了一个错误 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

我打算用GUI制作一个字典程序,但我在第一个关口就失败了。我刚刚安装了一个模块(),但是当我运行下面的代码时,我得到了一个错误

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实现的

不过,这个问题似乎已经解决了。你用pip安装了PyDictionary吗?如果是这样,请尝试直接从GitHub repo安装


编辑:我使用repo进行了测试,问题得到了解决。我建议你也这样做。如果您不确定如何执行此操作,请随时询问。

Pydrodictionary使用BeautifulSoup,因此通过使用Pydrodictionary,您实际上使用的是BeautifulSoup。Pydrodictionary似乎已经过时,因为它使用web请求,并使用旧的HTML解析器。