예제 #1
0
 def __init__(self, pages=24):
     self.headers = {
         'Accept':
         'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
         'Accept-Encoding':
         'gzip, deflate, br',
         'Accept-Language':
         'zh-CN,zh;q=0.9',
         'Connection':
         'keep-alive',
         'Host':
         'ip.jiangxianli.com',
         'Referer':
         'https://ip.jiangxianli.com/?page=2',
         'Sec-Fetch-Mode':
         'navigate',
         'Sec-Fetch-Site':
         'same-origin',
         'Upgrade-Insecure-Requests':
         '1',
         'User-Agent':
         'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
     }
     self.pages = pages
     self.db = DBClient()
     for page in range(1, self.pages + 1):
         self.fetch_proxy(page)
         time.sleep(5)
예제 #2
0
 def __init__(self, pages=2200):
     self.headers = {
         'Accept':
         'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
         'Accept-Encoding':
         'gzip, deflate',
         'Accept-Language':
         'zh-CN,zh;q=0.9',
         'Cache-Control':
         'max-age=0',
         'Connection':
         'keep-alive',
         'Host':
         'www.ip3366.net',
         'Referer':
         'http://www.ip3366.net/free/?stype=1&page=2',
         'Upgrade-Insecure-Requests':
         '1',
         'User-Agent':
         'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
     }
     self.pages = pages
     self.db = DBClient()
     for page in range(1, self.pages + 1):
         self.fetch_proxy(page)
         time.sleep(5)
예제 #3
0
class YunDaiLi1Client(object):

    def __init__(self,pages=2200):
        self.headers = {
        'Accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
        'Accept-Encoding': 'gzip, deflate',
        'Accept-Language': 'zh-CN,zh;q=0.9',
        'Cache-Control': 'max-age=0',
        'Connection': 'keep-alive',
        'Host': 'www.ip3366.net',
        'Referer': 'http://www.ip3366.net/free/?stype=1&page=2',
        'Upgrade-Insecure-Requests': '1',
        'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
        }
        self.pages = pages
        self.db = DBClient()
        for page in range(1,self.pages+1):
            self.fetch_proxy(page)
            time.sleep(5)

    def fetch_proxy(self,page):
        url = 'http://www.ip3366.net/free/?stype=1&page={page}'.format(page=str(page))
        self.headers['Referer'] = url
        response = requests.get(url,headers=self.headers)
        text = response.text
        html = etree.HTML(text)
        trs = html.xpath('//table[contains(@class,"table-bordered")]/tbody/tr')
        for tr in trs:
            try:
                ip = tr.xpath('./td[1]/text()')[0]
                port = tr.xpath('./td[2]/text()')[0]
                self.db.run(self.db.add(ip+':'+port))
            except Exception as e:
                continue
예제 #4
0
class QiYunVipClient(object):

    def __init__(self,pages=640):
        self.headers = {
            'authority': 'www.7yip.cn',
            'method': 'GET',
            'path': '/free/?action=china&page=1',
            'scheme': 'https',
            'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
            'accept-encoding': 'gzip, deflate, br',
            'accept-language': 'zh-CN,zh;q=0.9',
            'sec-fetch-mode': 'navigate',
            'sec-fetch-site': 'none',
            'sec-fetch-user': '******',
            'upgrade-insecure-requests': '1',
            'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
        }
        self.pages = pages
        self.db = DBClient()
        for page in range(1,self.pages+1):
            self.fetch_proxy(page)
            time.sleep(5)

    def fetch_proxy(self,page):
        url = 'https://www.7yip.cn/free/?action=china&page={page}'.format(page=str(page))
        self.headers['path'] = '/free/?action=china&page={page}'.format(page=str(page))
        response = requests.get(url,headers=self.headers)
        text = response.text
        html = etree.HTML(text)
        trs = html.xpath('//table[contains(@class,"table-bordered")]/tbody/tr')
        for tr in trs:
            ip = tr.xpath('./td[@data-title="IP"]/text()')[0]
            port = tr.xpath('./td[@data-title="PORT"]/text()')[0]
            self.db.run(self.db.add(ip+':'+port))
예제 #5
0
class XiCiWTClient(object):
    def __init__(self, pages=2200):
        self.headers = {
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
            'Accept-Encoding':
            'gzip, deflate, br',
            'Accept-Language':
            'zh-CN,zh;q=0.9',
            'Connection':
            'keep-alive',
            'Host':
            'www.xicidaili.com',
            'Referer':
            'https://www.xicidaili.com/nn/2',
            'Sec-Fetch-Mode':
            'navigate',
            'Sec-Fetch-Site':
            'same-origin',
            'Sec-Fetch-User':
            '******',
            'Upgrade-Insecure-Requests':
            '1',
            'User-Agent':
            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
        }
        self.pages = pages
        self.db = DBClient()
        for page in range(1, self.pages + 1):
            self.fetch_proxy(page)
            time.sleep(5)

    def fetch_proxy(self, page):
        url = 'https://www.xicidaili.com/wt/{page}'.format(page=str(page))
        self.headers['Referer'] = url
        response = requests.get(url, headers=self.headers)
        text = response.text
        html = etree.HTML(text)
        trs = html.xpath('//table[@id="ip_list"]/tr')
        for tr in trs:
            try:
                ip = tr.xpath('./td[2]/text()')[0]
                port = tr.xpath('./td[3]/text()')[0]
                self.db.run(self.db.add(ip + ':' + port))
            except Exception as e:
                continue
예제 #6
0
class JiangXianLiClient(object):
    def __init__(self, pages=24):
        self.headers = {
            'Accept':
            'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
            'Accept-Encoding':
            'gzip, deflate, br',
            'Accept-Language':
            'zh-CN,zh;q=0.9',
            'Connection':
            'keep-alive',
            'Host':
            'ip.jiangxianli.com',
            'Referer':
            'https://ip.jiangxianli.com/?page=2',
            'Sec-Fetch-Mode':
            'navigate',
            'Sec-Fetch-Site':
            'same-origin',
            'Upgrade-Insecure-Requests':
            '1',
            'User-Agent':
            'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
        }
        self.pages = pages
        self.db = DBClient()
        for page in range(1, self.pages + 1):
            self.fetch_proxy(page)
            time.sleep(5)

    def fetch_proxy(self, page):
        url = 'https://ip.jiangxianli.com/?page={page}'.format(page=str(page))
        self.headers['Referer'] = url
        response = requests.get(url, headers=self.headers)
        text = response.text
        html = etree.HTML(text)
        trs = html.xpath('//table[@class="layui-table"]/tbody/tr')
        for tr in trs:
            ip = tr.xpath('./td[1]/text()')[0].replace('\t',
                                                       '').replace('\n', '')
            port = tr.xpath('./td[2]/text()')[0].replace('\t',
                                                         '').replace('\n', '')
            self.db.run(self.db.add(ip + ':' + port))
예제 #7
0
 def __init__(self,pages=640):
     self.headers = {
         'authority': 'www.7yip.cn',
         'method': 'GET',
         'path': '/free/?action=china&page=1',
         'scheme': 'https',
         'accept': 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8,application/signed-exchange;v=b3;q=0.9',
         'accept-encoding': 'gzip, deflate, br',
         'accept-language': 'zh-CN,zh;q=0.9',
         'sec-fetch-mode': 'navigate',
         'sec-fetch-site': 'none',
         'sec-fetch-user': '******',
         'upgrade-insecure-requests': '1',
         'user-agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/79.0.3945.88 Safari/537.36'
     }
     self.pages = pages
     self.db = DBClient()
     for page in range(1,self.pages+1):
         self.fetch_proxy(page)
         time.sleep(5)