fetch_free_proxyes.py 文件源码

python
阅读 76 收藏 0 点赞 0 评论 0

项目:HttpProxy 作者: wuchujiecode 项目源码 文件源码
def check(proxy):
    import urllib2
    url = 'http://www.baidu.com/js/bdsug.js?v=1.0.3.0'
    proxy_handler = urllib2.ProxyHandler({'http': 'http://' + proxy})
    opener = urllib2.build_opener(proxy_handler, urllib2.HTTPHandler)
    try:
        response = opener.open(url, timeout=3)
        return response.code == 200 and response.url == url
    except Exception:
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号