Exemplo n.º 1
0
 def process_item(self, item, spider):
     ret = webProxy.check_proxy(item['ip'], item['port'])
     if ret:
         return item
     else:
         raise DropItem("Duplicate item found: %s:%s" %
                        (item['ip'], item['port']))
Exemplo n.º 2
0
#  python
# -*- coding: utf-8 -*-
# from sqlalchemy import exc
from conf.config import DBSession
from util import WebProxy as webProxy
from model.Proxy import Proxy

db = DBSession()
ips = db.query(Proxy).all()

for item in ips:
    ret = webProxy.check_proxy(item.ip, item.port)
    if not ret:
        webProxy.delete_proxy(item.ip, item.port)

Exemplo n.º 3
0
 def process_item(self, item, spider):
     ret = webProxy.check_proxy(item['ip'], item['port'])
     if ret:
         return item
     else:
         raise DropItem("Duplicate item found: %s:%s" % (item['ip'], item['port']))
 def __init__(self):
     self.proxies = webProxy.get_proxy_list()
 def __init__(self):
     self.proxies = webProxy.get_proxy_list()