当前位置:   article > 正文

python requests proxy socks5_proxy/socks: server rejects request: 5

proxy/socks: server rejects request: 5

访问不到某网址解决方法

  1. import requests
  2. headers = {
  3. 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/69.0.3497.100 Safari/537.36'}
  4. proxies = {
  5. 'http': 'socks5://127.0.0.1:10808', # 本地的代理转发
  6. 'https': 'socks5://127.0.0.1:10808'
  7. }
  8. url = "https://medium.com/"
  9. # url = "https://baidu.com/"
  10. response = requests.get(url, headers=headers, proxies=proxies, timeout=10)
  11. print(response)
  12. print(response.text)

--- socks5 转发到本地另一个软件 如下设置

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/482679
推荐阅读
相关标签
  

闽ICP备14008679号