By default, the?URLopener?class sends a?User-Agent?header of?urllib/VVV, where?VVV?is the?urllib?version number. Applications can define their own?User-Agent?header by subclassing?URLopener?orFancyURLopener?and setting the class attribute?version?to an appropriate string value in the subclass definition.
2018-08-06
2017-05-24
2.7的文檔
By default, the?URLopener?class sends a?User-Agent?header of?urllib/VVV, where?VVV?is the?urllib?version number. Applications can define their own?User-Agent?header by subclassing?URLopener?orFancyURLopener?and setting the class attribute?version?to an appropriate string value in the subclass definition.