@@ -0,0 +1,1493 @@
+# coding=utf-8%0A%0Afrom proxy import Proxy%0Afrom basespider import BaseSpider%0Afrom scrapy.selector import Selector%0A%0A%0Aclass ProxyDBSpider(BaseSpider):%0A    name = 'proxydb'%0A%0A    def __init__(self, *a, **kwargs):%0A        super(ProxyDBSpider, self).__init__(*a, **kwargs)%0A%0A        self.urls = %5B'http://proxydb.net/?protocol=http&protocol=https&offset=%25s' %25 n for n in range(1, 500, 50)%5D%0A        self.headers = %7B%0A            'Host': 'proxydb.net',%0A            'Upgrade-Insecure-Requests': '1',%0A            'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10.11; rv:50.0) Gecko/20100101 Firefox/50.0',%0A        %7D%0A%0A        self.is_record_web_page = True%0A        self.init()%0A%0A    def parse_page(self, response):%0A        super(ProxyDBSpider, self).parse_page(response)%0A%0A        data = response.xpath('//tbody/tr').extract()%0A        for i, d in enumerate(data):%0A            sel = Selector(text = d)%0A%0A            ip_port = sel.xpath('//td/a/text()').extract_first()%0A            ip = ip_port.split(':')%5B0%5D%0A            port = ip_port.split(':')%5B1%5D%0A            country = sel.xpath('//td/img/@title').extract_first()%0A            anonymity = sel.xpath('//td/span%5B@class=%22text-success%22%5D/text()').extract_first()%0A%0A            proxy = Proxy()%0A            proxy.set_value(%0A                    ip = ip,%0A                    port = port,%0A                    country = country,%0A                    anonymity = anonymity,%0A                    source = self.name%0A            )%0A%0A            self.add_proxy(proxy = proxy)%0A

添加 proxydb.py