Advertisement
Guest User

GetProxy

a guest
Oct 15th, 2019
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.56 KB | None | 0 0
  1. def get_proxy(as_link=False):
  2.     HTML = r.get("https://www.sslproxies.org/").text
  3.    
  4.     PROXIES = []
  5.  
  6.     if as_link:
  7.         for ADDRESS in zip(re.findall("<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>", HTML), re.findall("<td>\d+</td>", HTML)):
  8.             PROXIES.append({"https" : "https://" + ADDRESS[0] + ":" + ADDRESS[1][4:-5]})
  9.     else:
  10.         for ADDRESS in zip(re.findall("<td>(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})</td>", HTML), re.findall("<td>\d+</td>", HTML)):
  11.             PROXIES.append({ADDRESS[0]:ADDRESS[1][4:-5]})
  12.  
  13.  
  14.     return PROXIES
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement