ices_
2017-03-28 04:40python 新手爬虫代理问题
python newcoder,求解释下面代码
import urllib2
enable_proxy = True
proxy_handler = urllib2.ProxyHandler({"http" : 'http://some-proxy.com:8080'})
null_proxy_handler = urllib2.ProxyHandler({})
if enable_proxy:
opener = urllib2.build_opener(proxy_handler)
else:
opener = urllib2.build_opener(null_proxy_handler)
urllib2.install_opener(opener)
- 点赞
- 回答
- 收藏
- 复制链接分享
1条回答
为你推荐
- python实现新浪微博爬虫
- html5
- 正则表达式
- 新浪微博
- python
- 数据挖掘
- 1个回答
- 新手入门python爬虫问题请教,急急急
- python
- 1个回答
- C++里怎么调用Python爬虫?
- python
- c++
- 1个回答
- python爬虫去哪网热门景点
- python
- 爬虫
- 1个回答
- python爬虫制作接口怎么做
- python
- 爬虫
- 2个回答
换一换