3

我正在尝试从真正是单文件网页的 xls 文件中读取和提取数据,请参见下文

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

我试图弄清楚所有标签的含义,以便确保使用 lxml 正确解析它们。

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

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

虽然我在处理我正在玩弄的少数文件取得了成功,但我想弄清楚我是否在做出假设,这些假设后来会困扰我。因此,这些标签及其含义的列表会很棒。

4

1 回答 1

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.
于 2012-02-04T23:17:20.570 回答