Re: view page source or save after load



zephron2000 wrote:
Hey,

I need to either:

1. View the page source of a webpage after it loads

or

2. Save the webpage to my computer after it loads (same as File > Save
Page As)

urllib is not sufficient (using urlopen or something else in urllib
isn't going to do the trick)

Any ideas?

Thanks,
Lara




I happen to be tweaking a module that does this as your question came in. The relevant lines are:

fetchparams = urllib.urlencode(fetchparams)
wwwf = urllib.urlopen("?".join([baseurl, fetchparams]))
afile = open(filename, "w")
afile.write(wwwf.read())
afile.close()

James

--
James Stroud
UCLA-DOE Institute for Genomics and Proteomics
Box 951570
Los Angeles, CA 90095

http://www.jamesstroud.com/
.



Relevant Pages

  • Re: view page source or save after load
    ... Save the webpage to my computer after it loads (same as File> Save ... urllib is not sufficient (using urlopen or something else in urllib ... Windows, try the Internet Explorer Controller library, IEC: ...
    (comp.lang.python)
  • Re: The Empire Strikes Back
    ... There is a distinction between the webpage pulling in content and an "active ... it is not the web page doing it since the Flash SWF originated ... What matters is how the _web_page_ loads the external ...
    (borland.public.delphi.non-technical)
  • view page source or save after load
    ... Save the webpage to my computer after it loads (same as File> Save ... urllib is not sufficient (using urlopen or something else in urllib ... isn't going to do the trick) ...
    (comp.lang.python)
  • Re: How to receive events (eg. user mouse clicks) from IE
    ... as I switched the URL to a page that loads slowly, ... seems to allow both event hooks to run without blocking each other. ... > IE now loads the webpage and prompts the user. ... > invokes the Doc_Events method Ononactivate method. ...
    (comp.lang.python)
  • The page cannot be displayed message
    ... I am having a problem opening a specific webpage. ... All other pages are loading ... completely loads. ... -I am using Windows XP Pro. ...
    (microsoft.public.windows.inetexplorer.ie6.browser)