PyDocs

Nav

Internet Protocols and Support

build_opener

urllib.request

function (source) not WASI
  • build_opener([handler, ...])
Create an opener object from a list of handlers.

The opener will use several default handlers, including support
for HTTP, FTP and when applicable HTTPS.

If any of the handlers passed as arguments are subclasses of the
default handlers, the default handlers will not be used.
1 Example
>>> import urllib.request
>>> proxies = {'http': 'http://proxy.example.com:8080/'}
>>> opener = urllib.request.build_opener(urllib.request.ProxyHandler(proxies))
>>> with opener.open("https://www.python.org") as f:
...     f.read().decode('utf-8')
...
from the Python docs
See Also
No see-alsos for urllib.request/build_opener
0 Notes
No notes for build_opener