Python Interpreter
Mostrar más instrucciones
1
Importar la biblioteca " urllib2 ":
>>> import urllib2
2
Solicitar datos de una URL a través de la función " urlopen ":
>>> info = urllib2.urlopen ( ' http://www.google . com ' )
3
Imprima los datos de la variable. La variable contendrá el código fuente de la página web :
>>> print info.read ( 89 ) //lee 89 caracteres de la fuente filehtml > html head < meta http -equiv = contenido " content-type " = "text /html ; charset = ISO -8859 -1" >