2011-09-11 3 views

답변

4

: HTTP를 할 수 요청을 스푸핑하는 방법

1.1을 준수 당신은 설정 다음 (미등록)과 함께 Scrapy HTTP 클라이언트 공장을 대체하여이 작업을 수행 할 수 있습니다 : 여기

DOWNLOADER_HTTPCLIENTFACTORY = 'myproject.downloader.HTTPClientFactory' 

A의 myproject.downloader 모듈의 가능한 구현 :

from scrapy.core.downloader.webclient import ScrapyHTTPClientFactory, ScrapyHTTPPageGetter 

class PageGetter(ScrapyHTTPPageGetter): 

    def sendCommand(self, command, path): 
     self.transport.write('%s %s HTTP/1.1\r\n' % (command, path)) 

class HTTPClientFactory(ScrapyHTTPClientFactory): 

    protocol = PageGetter   
+0

그게 작동합니다. 감사. – user891260

관련 문제