[lxml-dev] About the position of html parsing by HTML Target parser

Stefan Behnel stefan_ml at behnel.de
Mon Jul 20 09:11:42 CEST 2009


qhlonline wrote:
> 2009-07-17£¬"Stefan Behnel" wrote£º
>> That said, I still do not understand why you need the character stream
>> position for parsing. Could you elaborate on that?
>
> Well, the position information is usefull. Some outside source of HTML
> document is declared in a seperate file, like <style> 'css' file. We may
> get the HTML document and its related source on net concurrently. But
> the outside source should be inserted in the proper position of HTML
> document in out application after parse. so the related tag position is
> usefull now.

I still don't understand what you need the stream position for. If you want
to inject data into the tree, just find the right element and do so.

Or did you mean that you are actually doing a /textual/ replacement here?

Stefan


More information about the lxml-dev mailing list