urllib http status codes

Kent Johnson kent at kentsjohnson.com
Wed Dec 28 22:48:20 EST 2005


Alvin A. Delagon wrote:
> Greetings!
> 
> Is there any way I can obtain the HTTP status codes when using the 
> urllib module? As of  now I can only think of doing a regex on the 
> result of the read(). Thanks in advance! ^_^

If you connect with httplib you get the status code directly from the 
response object.

Kent



More information about the Python-list mailing list