1
houzhimeng 2019-01-04 16:56:20 +08:00
|
2
Ewig OP @houzhimeng import base64
class proxy_middleware(object): def __init__(self): proxy_host = "w.t.16yn" proxy_port = "***" self.username = "***" self.password = "**" self.proxies = {"http": "http://{}:{}/".format(proxy_host, proxy_port)} self.proxy_server = 'https://w5.t.16yun.cn:6469' self.proxy_authorization = 'Basic ' + base64.urlsafe_b64encode( bytes((self.username + ':' + self.password), 'ascii')).decode('utf8') def process_request(self, request, spider): request.meta['proxy'] = self.proxy_server request.headers['Proxy-Authorization'] = self.proxy_authorization 我改成这样还是不行 |
3
15399905591 2019-01-04 17:28:04 +08:00
|
4
huaerxiela 2019-01-04 17:39:44 +08:00
|
5
houzhimeng 2019-01-04 18:29:05 +08:00
https://github.com/scrapy/scrapy/issues/1855 你看看这个情况跟你一样么?
|
6
Ewig OP @15399905591 为啥这个原因
|