[lxml-dev] lxml about Target Parser
Stefan Behnel
stefan_ml at behnel.de
Tue Jun 2 20:12:54 CEST 2009
qhlonline wrote:
> When I used the lxml with self defined Target Parser, There is a
> function that can be redefined-- data . def data (self, data): When can
> we use it?
when you want to receive character content from the document you parse.
> and what it will do when we simply write a single line: "return " ?
nothing? actually, a "pass" will do in that case, as will not implementing
the method (IIRC).
> Is there any encoding conversion?
You will get either ASCII encoded byte strings or unicode strings, just
like everywhere else.
BTW, it's sometimes faster to try these things out than to ask a mailing list.
Stefan
More information about the lxml-dev
mailing list