据我所知,Python中的两个主要HTML解析库是lxml和BeautifulSoup.我选择了BeautifulSoup作为我正在研究的项目,但除了找到更容易学习和理解的语法之外,我选择了它.但是我看到很多人似乎都喜欢lxml而且我听说lxml更快.
所以我想知道一个优于另一个的优点是什么?我什么时候想使用lxml?什么时候最好使用BeautifulSoup?还有其他值得考虑的图书馆吗?
python lxml beautifulsoup html-parsing
beautifulsoup ×1
html-parsing ×1
lxml ×1
python ×1