很简单:
proxies={'http': 'http://127.0.0.1:xxxx', 'https': 'xxxxhttp://127.0.0.1:xxxx'}
response = requests.get('https://www.drugbank.ca/drugs/', headers=headers, proxies=proxies)
这个xxxx不要照抄
换成红色那块端口,debug就发现response code变成了200.
很简单:
proxies={'http': 'http://127.0.0.1:xxxx', 'https': 'xxxxhttp://127.0.0.1:xxxx'}
response = requests.get('https://www.drugbank.ca/drugs/', headers=headers, proxies=proxies)
这个xxxx不要照抄
换成红色那块端口,debug就发现response code变成了200.