阅读背景:

Python:使用请求通过代理访问HTTPS URL

来源:互联网 
import shutil
import requests
import json

proxy = {
'user' : 'user',
'pass' : 'password',
'host' : "test.net",
'port' : 8080
}

url = 'https://github.com/timeline.json'
response = requests.get(url,verify=True, proxies={"https" : \
"https://%(user)s:%(pass)s@%(host)s:%(port)d" % proxy})

with open(r'..\test.json','wb') as out_file:
      out_file.write(response.text)
print response
import shutil
import requests
import json

prox



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: