是否有标签的某个主列表及其对mhtml文件的含义?

时间:2011-09-20 16:05:51

标签: python excel lxml mhtml

我正在尝试从xls文件中读取和提取数据,这些文件实际上是单文件网页,如下所示

This document is a Single File Web Page, also known as a Web Archive file.  

我试图找出所有标签的含义,这样我就可以确保使用lxml正确解析它们。

例如,这里是一个标签的例子:

 <th class=3Dtl colspan=3D1 rowspan=3D2

虽然我正在努力处理我正在玩弄的几个文件,但我想弄清楚我是否在做出假设,以后会再次困扰我。因此,这些标签的列表及其含义将是很好的。

1 个答案:

答案 0 :(得分:0)

如果MHTML是从Microsoft Word生成的,那么它可能是WordprocessingMLHTML4标签的组合。

  

WordprocessingML文档中的顶级元素是:

SmartTagType element describes a Smart Tag type used in the document.
DocumentProperties element contains Office Document Properties.
CustomDocumentProperties element contains Custom Office Document Properties.
schemaLibrary element defines a collection of schemas that comprise a document's schema library.
fonts element (wordDocumentElt complexType) contains font information
frameset element (wordDocumentElt complexType) contains HTML Frameset definitions.
styles element (wordDocumentElt complexType) contains style definitions.
divs element contains HTML DIV information.
shapeDefaults element contains drawing defaults.
docOleData element contains supplemental data containing storages for OLE objects.
docSuppData element contains supplemental data containing toolbar customizations, envelope data, and the Microsoft Visual Basic project.
docPr element contains document options.
shapeDefaults element contains the wrapper representing the shape defaults.
bgPict element contains background picture information.
body element contains the document body.
  

但是,最简单的WordprocessingML文档只包含五个元素(和一个命名空间)。五个要素是:

wordDocument element: The root element for a WordprocessingML document.
body element: The container for the displayable text.
p element: A paragraph.
r element: A contiguous set of WordprocessingML components with a consistent set of properties.
t element: A piece of text.