response = requests.get(url, proxy=Porxy2) Traceback (most recent call last): File "E:\Program Files\JetBrains\PyCharm 2020.1\plugins\python\helpers\pydev\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec exec(exp, global_vars, local_vars) File "<input>", line 1, in <module> File "C:\Users\PcRobber9th\.conda\envs\cv2_cp38\lib\site-packages\requests\api.py", line 73, in get return request("get", url, params=params, **kwargs) File "C:\Users\PcRobber9th\.conda\envs\cv2_cp38\lib\site-packages\requests\api.py", line 59, in request return session.request(method=method, url=url, **kwargs) TypeError: request() got an unexpected keyword argument 'proxy'
时间: 2023-07-21 21:27:36 浏览: 85
深入解析Python中的urllib2模块
这个错误是因为在代码中,`requests.get()`函数的`proxy`参数应该是`proxies`。请将`proxy`参数改为`proxies`参数,例如:
```
proxies = {
'http': 'http://localhost:8080',
'https': 'http://localhost:8080'
}
response = requests.get(url, proxies=proxies)
```
阅读全文