Just ten minutes ago , In the Q & A area and qq The group posted this question ,qq A big guy of the group shared notes about this function , I put it in some order , And published in csdn On the platform
build_opener(*handlers) Method is used to build a custom OpenerDirector object
# python2
from urllib2 import build_opener
# python3
from urllib.request import build_opener
build.opener(handler1,handler2…)
OpenerDiretop example – opener object