执行get请求时报错
import requests
url = "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fa2.att.hudong.com%2F50%2F70%2F50200009239445156156701777351.jpg&refer=http%3A%2F%2Fa2.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1640508539&t=401ddae015b63aaee2608b838f4707a6"
r = requests.get(url)
data = r.content
with open('1.jpg','wb') as f:
f.write(data)
报错结果:
ProxyError: HTTPSConnectionPool(host='gimg2.baidu.com', port=443): Max retries exceeded with url: /image_search/src=http%3A%2F%2Fa2.att.hudong.com%2F50%2F70%2F50200009239445156156701777351.jpg&refer=http%3A%2F%2Fa2.att.hudong.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1640508539&t=401ddae015b63aaee2608b838f4707a6 (Caused by ProxyError('Cannot connect to proxy.', OSError('Tunnel connection failed: 407 authenticationrequired')))