view page source or save after load

Gabriel Genellina gagsl-py at yahoo.com.ar
Thu Sep 21 09:27:03 CEST 2006


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



Gabriel Genellina
Softlab SRL 


	
	
		
__________________________________________________
Preguntá. Respondé. Descubrí.
Todo lo que querías saber, y lo que ni imaginabas,
está en Yahoo! Respuestas (Beta).
¡Probalo ya! 
http://www.yahoo.com.ar/respuestas




More information about the Python-list mailing list