Answers for "urllib3 request in python"

1

urllib.request.urlretrieve

>>> import urllib.request
>>> #urllib.request.urlretrieve(url, filename=None, reporthook=None, data=None)
#Copy a network object denoted by a URL to a local file
>>> local_filename, headers = urllib.request.urlretrieve('http://python.org/')
>>> html = open(local_filename)
>>> html.close()
Posted by: Guest on October-05-2021
1

urllib3 python

>>> import urllib3
>>> http = urllib3.PoolManager()
>>> r = http.request('GET', 'http://httpbin.org/robots.txt')
>>> r.status
200
>>> r.data
'User-agent: *nDisallow: /denyn'
Posted by: Guest on August-13-2020

Python Answers by Framework

Browse Popular Code Answers by Language