ID EN
Urllib Request

install_opener

Python 3.11

Install an OpenerDirector instance as the default global opener. Installing an opener is only necessary if you want urlopen to use that opener; otherwise, simply call OpenerDirector.open() instead of urlopen(). The code does not check for a real OpenerDirector, and any class with the appropriate interface will work.

Syntax

PYTHON
urllib.request.install_opener(opener)

See Also

OpenerDirector OpenerDirector.open() urlopen() OpenerDirector