python库
requests
eg
# coding=utf-8
import requests
global fail_count
def request(url):
response = requests.get(url, allow_redirects=False);
if response.status_code != 200:
fail_count += 1
print len(response.text)
print response.text
print response.headers
if __name__ == '__main__':
url = 'http://baidu.com'
request(url);