python库

requests

http://blog.csdn.net/iloveyin/article/details/21444613

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);

eventlet

http://bingotree.cn/?p=281

posted @ 2015-07-31 00:28  fly1988happy  阅读(154)  评论(0编辑  收藏  举报