## KOD CYBER-WARRİOR İÇİN KODLANMIŞTIR.


from bs4 import BeautifulSoup
import requests
from time import sleep
import re


class Capture(object):
    def __init__(self,website):
        self.website = website
        self.source = BeautifulSoup(requests.get(self.website).content,"html.parser")
        self.ip_adress = []
        self.ip_port = []
        self.counter = 0
        self.country = []
        self.get_ip_adress()

    def get_ip_adress(self):
        scrape = self.source.find("table",attrs={"id":"proxylisttable"})
        scrape_data = scrape.find("tbody")
        for a in scrape_data.find_all("tr"):
            self.ip_adress.append(((re.sub("<.*?>","",str(a.find_all("td")[0])))))
            self.ip_port.append(re.sub("<.*?>","",str(a.find_all("td")[1])))
            self.country.append(re.sub("<.*?>","",str(a.find_all("td")[3]))) 

    @property
    def show_ip_adress(self):
        for ip in self.ip_adress:
            print("İP ADRESS {} : {} >>>>> {}".format(self.ip_adress[self.counter],self.ip_port[self.counter],self.country[self.counter]))
            self.counter += 1


    @property
    def count(self):
       return(len(self.ip_adress),len(self.ip_port))


if __name__ == '__main__':
    print("""
            Bu script Cyber-Warrior için kodlanmıştır.
                    Dağıztanlı08.                         
            """)
    
    sleep(1) 
    a = Capture("https://free-proxy-list.net/")
    a.show_ip_adress
    print(a.count)









