HTML parser in Python

2019-02-09 18:15发布

Using the Python Documentation I found the HTML parser but I have no idea which library to import to use it, how do I find this out (bearing in mind it doesn't say on the page).

标签: python import
8条回答
在下西门庆
2楼-- · 2019-02-09 18:43

There's a link to an example on the bottom of (http://docs.python.org/2/library/htmlparser.html) , it just doesn't work with the original python or python3. It has to be python2 as it says on the top.

查看更多
时光不老,我们不散
3楼-- · 2019-02-09 18:50

I don't recommend BeautifulSoup if you want speed. lxml is much, much faster, and you can fall back in lxml's BS soupparser if the default parser doesn't work.

查看更多
登录 后发表回答