Slurping Web Pages

Dave Brueck dave at pythonapocrypha.com
Sat Jan 25 17:04:59 EST 2003


On Sat, 25 Jan 2003, Tony Dunn wrote:

> I've started a new project where I need to slurp web pages from a site that
> use cookies to authenticate access.  I've used *urllib* in the past to grab
> *public* web pages, but I'm not sure the best way to go about dealing with
> the cookie issue.
>
> I found some code to drive IE via COM, but I can't find a method to save the
> current web page to a file so I can *slurp* it later.  I've wandered through
> the file generated by makepy.py for the *Internet Control* COM object, but I
> don't see what I'm looking for.  I know I can grab the files from the local
> *Internet* cache, but I'd like the option to specify a file location and
> file name for each page downloaded.

Hi Tony,

I think some objects in the page DOM have an innerHTML member that lets
you grab all the page source (or most of it - I think for example the body
element has an innerHTML member at least). Search around on MSDN for that
and I'll also poke around in some old code to see what I can find.

-Dave





More information about the Python-list mailing list