Tramite questo programma potete scrivre dentro un file di testo .txt una lista di proxy recuperata in tempo reale.
Utilizzo la libreria Proxy_List_Scrapper scaricabile tramite
Codice:
pip install Proxy-List-Scrapper
Se non volete salvare il risultato in un file di testo ma volete stamparla in ouput allora dovrete modificare le righe 6..13 ovvero:
Python:
path = input("Enter the path of the .txt file on which to write the proxies: ")
f = open(path, "a")
for item in data.proxies:
proxy = '{}:{}\n'.format(item.ip, item.port)
f.write(proxy)
f.close()
Python:
for item in data.proxies:
print('{}:{}\n'.format(item.ip, item.port))
Descrizione del programma
Proxy-List-Scrapper
Proxy List Scrapper from various websites. They gives the free proxies for temporary use.Usage
- Install Proxy-List-Scrapper pip install Proxy-List-Scrapper Make sure you have installed the requests and urllib3 in python
- In import add from Proxy_List_Scrapper import Scrapper, Proxy, ScrapperException
- After that simply create an object of Scrapper class as "scrapper" scrapper = Scrapper(category=Category, print_err_trace=False)
- Here Your need to specify category defined as below:
Type Link SSL 'https://www.sslproxies.org/' GOOGLE 'https://www.google-proxy.net/' ANANY 'https://free-proxy-list.net/anonymous-proxy.html' UK 'https://free-proxy-list.net/uk-proxy.html' US 'https://www.us-proxy.org/' NEW 'https://free-proxy-list.net/' SPYS_ME 'http://spys.me/proxy.txt' PROXYSCRAPE 'https://api.proxyscrape.com/?request=getproxies&proxytype=all&country=all&ssl=all&anonymity=all' PROXYNOVA 'https://www.proxynova.com/proxy-server-list/' PROXYLIST_DOWNLOAD_HTTP 'https://www.proxy-list.download/HTTP' PROXYLIST_DOWNLOAD_HTTPS 'https://www.proxy-list.download/HTTPS' PROXYLIST_DOWNLOAD_SOCKS4 'https://www.proxy-list.download/SOCKS4' PROXYLIST_DOWNLOAD_SOCKS5 'https://www.proxy-list.download/SOCKS5' ALL 'ALL' - Get ALL Proxies According to your Choice data = scrapper.getProxies()
- @proxies is the list of Proxy Class which has actual proxy.
- @len is the count of total proxies in @proxies.
- @category is the category of proxies defined above.
Download