[weboob] ask for documentation!

Christophe Benz christophe.benz at gmail.com
Mon Apr 12 11:17:25 CEST 2010


Le Mon, 12 Apr 2010 11:11:23 +0200,
Romain Bignon <romain at peerfuse.org> a écrit :

> On 12/Apr - 11:00, Christophe Benz wrote:
> > Crap, there is no doc about the browser and pages.
> 
> Yes, I think I should write documentation of all this classes and
> systems.

Or I can do it too (on the wiki) when I'll have some time ;-)

> > I understood by reading the code that:
> > 
> > * Browser.location opens a webpage with mechanize
> > * the Parser parses the DOM
> > * finds the corresponding class in the Browser.PAGES dict
> > * calls the Page.loaded method.
> 
> This is basically how it works, yes.
> 
> > Since I only want to match an URL using a regex, and I don't want to
> > deal with the DOM at all, where do I put the code? Do I have to
> > write a dedicated parser, and not to use any page, or to use
> > Page.loaded?
> 
> I think if you don't want to use any parser, you may use the
> openurl() method instead of location(). You can see an example on
> weboob.backends.canaltp.browser.

Thanks.

> > I had a problem with StandardParser which did not accept some HTML
> > code. I used the html5lib parser, like in aum backend.
> > By the way, would it be possible to have all the parsers available
> > in weboob.tools.parser(s)?
> 
> You're right, we should add every available parsers in
> weboob.tools.parser. For example, weboob.backends.bnporc works with
> elementtidy but not with HTMLParser, so there as you disabled the
> elementtidy parser, it does not work anymore.

OK, so the parsers toolbox would avoid this kind of problems.


-- 
Christophe Benz
http://cbenz.pointique.org



More information about the weboob mailing list