htmlparse()

Read(117) Label: html, tag,

Description:

Get text data under a specified tag in an html file.

Syntax:

s.htmlparse(tag:i:j,…)

Note:

The function gets the jth text file under the ith tag from html file s. Get all data in the html file when there aren’t parameters.

Parameter:

s

Content of an html file

tag

A tag in an html file; if the tag’s value is “table”, get all data under it

i

An integer

j

An integer

Return value:

A sequence

Example:

 

A

 

1

=file("D:/test.html").read()

Read the content of an html file.

2

=A1.htmlparse("a":11:0)

Get the 1st text file under the 12th <a> from A1’s html file.

3

=A1.htmlparse("a":11:0, "span":8:0)

Get text files under two tags from A1’s html file.

4

=A1.htmlparse("table":7)

Get all content under the 8th <table>.