Reputation: 57
this is my codes:
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)
error:
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'
I goolge it ,but nothing relevant. It's so strange that i can't figure out...
Upvotes: 0
Views: 1155
Reputation: 49577
From urllib3 docs
get_url(url, fields=None, **urlopen_kw)
Deprecated since version 1.0.
Use request() instead.
Upvotes: 2