問題:瀏覽器
from urllib.error import URLError from urllib.request import ProxyHandler, build_opener proxy = '171.41.80.166:9999' proxy_handler = ProxyHandler({ 'http': 'http://' + proxy, 'https': 'https://' + proxy }) opener = build_opener(proxy_handler) try: response = opener.open('http://httpbin.org/get') print(response.read().decode('utf-8')) except URLError as e: print(e.reason)
報錯以下:ui
解決:url