这是我的代码:
import urllib3
url='http://www.google.com/'
http_pool = urllib3.connection_from_url(url)
content = http_pool.get_url('/')
print (content.info())
print ('----------------------------')
page = content.read()
print (page)
错误:
Traceback (most recent call last):
File "C:\python\test.py", line 24, in <module>
content = http_pool.get_url('/')
AttributeError: 'HTTPConnectionPool' object has no attribute 'get_url'
我谷歌它,但没有什么相关的。太奇怪了,我想不通...