Mechanize/Browser question

John J. Lee jjlee at reportlab.com
Mon Jul 10 16:07:27 EDT 2006


"Diez B. Roggisch" <deets at nospam.web.de> writes:

> bruce schrieb:
> > hi...
> > i can do the following
> >   br = Browser
> >   br.open("www.yahoo.com")
> >   br.open("file:///foo")
> >  but can i do
> >   s = "..." <<<< qualified html text
> >   br.open(s)
> >  i'm curious, if i have html from someother source, is there a way
> > to simply
> > get it into the "Browser" so i can modify it...
> 
> Use the tempfile-module to create a temporary file, write your HTML in
> there and point the browser to it. Alternatively, you could fire up a
> SimpleHTTPServer and serve the content. For HTML-only this would be
> overkill, but if you need images as well it might be worth it.

There are better/other ways which I've already pointed bruce to on the
mailing list that covers module mechanize
(wwwsearch-general at lists.sourceforge.net).

I've asked Bruce not to cross-post all this stuff -- partly since he's
not likely to get a good answer from anybody but me and the others on
that list, but also to avoid irritating everybody on c.l.py ;-)


John



More information about the Python-list mailing list