[Tutor] find data in html file

Don Arnold darnold992000 at yahoo.com
Tue Sep 27 19:55:15 CEST 2005

--- lmac <lopoff at gmx.net> wrote:

> Hi there,
> i have a base-question. If i want to read some kind
> of data out of a line
> which i know the start-tag and the end-tag in an
> html-file how do i 
> recognize
> if it's more than one line ?
> Example:
> <td>Some text<a href>link</a>text ..... DATA
> ....</tr></td> etc.
> I would use >text as the starting tag to localize
> the beginning of the DATA.
> And then </tr> as the ending tag of the DATA. But if
> there is \n then 
> there are more than
> one line.
> I hope i explained it well what i am going for.
> English is not my native 
> language.
> Thank you.

As you've seen, normal string-handling methods aren't
very useful for parsing complicated (or even simple)
HTML documents. For parsing these, take a look at the
HTMLParser or htmllib modules.


Yahoo! Mail - PC Magazine Editors' Choice 2005 

More information about the Tutor mailing list