python urllib如何获取http状态码

f=urllib.urlopen("xxxxxx")

print f.getcode() #这就是获取返回的状态码 404 200等

你可能感兴趣的:(python urllib如何获取http状态码)