(self)
| 60 | 随机选择proxy的中间件 |
| 61 | ''' |
| 62 | def __init__(self): |
| 63 | from shannon_spider.conf.proxy import PROXY_LIST, CONTINUOUS_USE_COUNT |
| 64 | self.continuous_use_count = CONTINUOUS_USE_COUNT |
| 65 | self.proxy_list = PROXY_LIST |
| 66 | self.used_count = {} |
| 67 | self.failed_count = {} |
| 68 | self.logger = logging.getLogger('proxy') |
| 69 | for proxy in self.proxy_list: |
| 70 | self.used_count[proxy] = 0 |
| 71 | self.failed_count[proxy] = 0 |
| 72 | |
| 73 | @classmethod |
| 74 | def from_crawler(cls, crawler): |
nothing calls this directly
no outgoing calls
no test coverage detected