Proxy Check in python

后端 未结 4 459
既然无缘
既然无缘 2020-12-23 14:55

I have written a script in python that uses cookies and POST/GET. I also included proxy support in my script. However, when one enters a dead proxy, the script crashes. Is t

4条回答
  •  Happy的楠姐
    2020-12-23 15:47

    you can use the Proxy-checker library which is as simple as this

    from proxy_checker import ProxyChecker
    
    checker = ProxyChecker()
    checker.check_proxy(':')
    

    output :

    {
      "country": "United States",
      "country_code": "US",
      "protocols": [
      "socks4",
      "socks5"
      ],
      "anonymity": "Elite",
      "timeout": 1649
    }
    

    with the possibility of generating your own proxies and check them with two lines of code

提交回复
热议问题