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
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
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
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
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