Utilizando Python 2.6 se puede hacer lo siguiente
{{{
#!python
>>> from urllib import urlopen
>>> f = urlopen('http://www.google.com')
>>> f.getcode()
200
}}}
pero con Python 2.5 lo q c obtiene es esto
{{{
#!python
>>> from urllib import urlopen
>>> f = urlopen('http://www.google.com')
f.getcode()>>> f.getcode()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: addinfourl instance has no attribute 'getcode'
}}}
Q:
- Cómo c obtiene el código (status) de una respuesta HTTP
con Python 2.5 ?
Gracias por adelantado !
--
Regards,
Olemis.
Blog ES: http://simelo-es.blogspot.com/
Blog EN: http://simelo-en.blogspot.com/
Featured article:
Funcionalidades no documentadas de la API de Facebook -
http://feedproxy.google.com/~r/simelo-es/~3/Xe1QvtmzSXY/funcionalidades-no-documentadas-de-la.html
_______________________________________________
Python-es mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-es
FAQ: http://python-es-faq.wikidot.com/