【发布时间】:2017-08-24 14:06:20
【问题描述】:
Splash 不适用于 Privoxy/Tor。虽然
- Privoxy/Tor 在浏览器中工作。
- Splash 可与普通代理一起使用。
yield SplashRequest(url, self.parse_func, args={'wait': 2.5, 'proxy': 'http://a_proxy_address:port', })。 - 没有 Splash 的 Scrapy 通过 Privoxy 工作。
yield scrapy.Request(url, callback=self.parse_func, meta={'proxy': 'http://127.0.0.1:8118'}))。
在脚本 Splash 中给出错误 502。
如果尝试在浏览器中打开 Splash 页面localhost:8050,它会给出错误页面:
Privoxy was unable to socks5t-forward your request http://localhost:8050/ through localhost: SOCKS5 request failed
/etc/privoxy/config:
forward-socks5 / localhost:9050 .
forward-socks4 / localhost:9050 .
forward-socks4a / localhost:9050 .
forward-socks5t / localhost:9050 .
我也尝试在以下行中添加/etc/privoxy/config,但没有帮助。
forward localhost .
【问题讨论】:
-
你在 docker 里面运行 splash 吗?
-
是的,
sudo docker run -p 8050:8050 scrapinghub/splash
标签: scrapy tor splash-screen scrapy-splash privoxy