阅读背景:

在必须使用regex在html文档中查找内容之后,回到使用lxml的最佳方式

来源:互联网 

I am trying to rip some text out of a large number of html documents (numbers in the hundreds of thousands). The documents are really forms but they are prepared by a very large group of different organizations so there is significant variation in how they create the document. For example, the documents are divided into chapters. I might want to extract the contents of Chapter 5 from every document so I can analyze the content of the chapter. Initially I thought this would be easy but it turns out that the authors might use a set of non-nested tables throughout the document to hold the content so that Chapter n could be displayed using td tags inside a table. Or they might use other elements such as p tags H tags, div tags or any other block level element. I am trying to rip some text out of a large num




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: