Advertisement
alperiox

check_proxy function and proxy filtreing

Oct 1st, 2022
1,128
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.29 KB | Source Code | 0 0
  1. def check_proxy(proxy):
  2.     """
  3.    Checks the proxy server by sending a GET request to httpbin.
  4.    Returns False if there is an error from the `get` function
  5.    """
  6.    
  7.     return get("http://httpbin.org/ip", proxy) is not None
  8.  
  9. available_proxies = list(filter(check_proxy, proxies))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement