0

我正在尝试通过标题的类别来解析这个网页(可搜索的,从手的特殊召唤等)我四处寻找一个好的 3.3 解析器,但我能找到的只是 BeautifulSoup(我可以'不安装,因为它仍然在 2.x 中编码)和我无法理解的 lxml。我尝试阅读 HTML 本身并搜索标题的代码,但无济于事。谁能帮我?

4

1 回答 1

1

实际上,您可以使用 Beautiful Soup for Python 3.x。美丽的汤主页说:

Beautiful Soup 4 works on both Python 2 (2.6+) and Python 3.

Beautiful Soup is licensed under the MIT license, so you can also download the 
tarball, drop the bs4/ directory into almost any Python application (or into 
your library path) and start using it immediately. (If you want to do this under 
Python 3, you will need to manually convert the code using 2to3.)

如果您需要有关如何手动将 Python 2 代码转换为 Python 3 的帮助,请参阅为 Python 3 转换 BeautifulSoup 4 以获取说明。HTH。

于 2013-04-04T02:08:47.493 回答