urllib2

urllib2

1、urllib2.urlopen(),参数可填url字符串,或者一个Request对象。

2、Request对象的set_proxy(proxy, type)可以设置代理。

3、urlopen的返回值的read()方法,可以body内容读取出来。

参考:https://docs.python.org/2.7/library/urllib2.html

原文地址:https://www.cnblogs.com/tekkaman/p/5594324.html