Xpath vs DOM vs BeautifulSoup vs lxml vs other Which is the fastest approach to parse a webpage?

后端 未结 2 1582
孤城傲影
孤城傲影 2020-12-15 13:08

I know how to parse a page using Python. My question is which is the fastest method of all parsing techniques, how fast is it from others?

The parsing techniques I k

相关标签:
2条回答
  • 2020-12-15 13:25

    http://blog.ianbicking.org/2008/03/30/python-html-parser-performance/

    Comparison

    0 讨论(0)
  • 2020-12-15 13:38

    lxml was written on C. And if you use x86 it is best chose. If we speak about techniques there is no big difference between Xpath and DOM - it's very quickly methods. But if you will use find or findAll in BeautifulSoup it will be slow than other. BeautifulSoup was written on Python. This lib needs a lot of memory for parse any data and, of course, it use standard search methods from python libs.

    0 讨论(0)
提交回复
热议问题