Поисковик прокси

velthat
Оффлайн

velthat

Пользователь
НЕ ПРОВЕРЕН
Регистрация
13.03.26
Сообщения
3
Реакции
0
Репутация
0
Приветствую!
Получил в руки простенький прокси серчер для spys.one, написанный на python (классический парсер)

Установка библиотек:
Код:
pip install requests beautifulsoup4 colorama

Сам скрипт:
Код:
import requests
from bs4 import BeautifulSoup
from colorama import Fore, Style

print(Style.BRIGHT + "Searching proxies..."  + Style.RESET_ALL)
        
url = 'https://spys.one/ru/'

headers = {
    'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko)'
                  ' Chrome/89.0.4389.82 Safari/537.36'
}

response = requests.get(url, headers=headers)
response.raise_for_status()
print(Style.BRIGHT + "Found proxies:"  + Style.RESET_ALL)
if response.status_code == 200:
    
    soup = BeautifulSoup(response.text, 'html.parser')
    
    elements = soup.find_all(class_='spy14')
    filtered_array = [item for item in elements if "." in item.get_text()]
    for idx, element in enumerate(filtered_array, start=1):
        vpn = element.get_text(strip=True)
        if idx == len(filtered_array):
            print(Fore.LIGHTYELLOW_EX + Style.BRIGHT + '   └── '+"["+str(idx)+"] "  + Style.RESET_ALL +  vpn)
        else:
            print(Fore.LIGHTYELLOW_EX + Style.BRIGHT + '   ├── ' +"["+str(idx)+"] "  + Style.RESET_ALL +  vpn)
            
else:
    print(Fore.LIGHTRED_EX + Style.BRIGHT + "ERROR! Try a bit later" + Style.RESET_ALL)
 
Профиль пользователя НЕ ПРОВЕРЕН! Будьте внимательны при работе с ним!
Подробнее о снятии "НЕ ПРОВЕРЕН" >>>здесь<<<
Сверху Снизу