Re: view page source or save after load

2006-09-21 Thread James Stroud
Gabriel Genellina wrote: > At Thursday 21/9/2006 02:26, alex23 wrote: > >> page = urllib.urlopen('http://some.address') > > add .read() at the end > >> open('saved_page.txt','w').write(page).close() > > write() does not return the file object, so this won't work; you have to > bind the file to

Re: view page source or save after load

2006-09-21 Thread alex23
Gabriel Genellina wrote: Thanks for the corrections, Gabriel. I really need to learn to cut&paste working code :) Cheers. -alex23 -- http://mail.python.org/mailman/listinfo/python-list

Re: view page source or save after load

2006-09-21 Thread Gabriel Genellina
At Thursday 21/9/2006 02:26, alex23 wrote: page = urllib.urlopen('http://some.address') add .read() at the end open('saved_page.txt','w').write(page).close() write() does not return the file object, so this won't work; you have to bind the file to a temporary variable to be able to close

Re: view page source or save after load

2006-09-20 Thread alex23
zephron2000 wrote: > 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) You don't reall

Re: view page source or save after load

2006-09-20 Thread James Stroud
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 t