fp = hashlib.sha1() fp.update(to_bytes(request.method)) fp.update(to_bytes(canonicalize_url(request.url))) fp.update(request.body or b'') return fp.hexdigest()
def enqueue_request(self, request): if not request.dont_filter and self.df.request_seen(request): self.df.log(request, self.spider) return False self.queue.push(request) return True
每臺電腦從redis數據庫中對應的redis_key名稱中獲取url,發起請求。redis