3

我在将 Scrapy-Splash 与 HTTP 代理一起使用时遇到了一些问题(请参阅将 Scrapy over Splash 与 HTTP 代理结合使用时的“500 Internal Server Error”),即使我尝试在http://splash之后设置代理配置文件也是如此.readthedocs.io/en/latest/api.html#proxy-profiles

为了更好地了解发生了什么,我一直在寻找 Scrapy-Splash 源代码的一部分,https://github.com/scrapy-plugins/scrapy-splash,它解析代理hostport.ini文件中指定/etc/splash/proxy-profiles.

但是,在存储库中搜索“proxy”或“.ini”没有产生任何结果。有人可以向我解释一下代理分析是如何在 Scrapy-Splash 中实现的吗?

4

1 回答 1

1

首先,Scrapy-Splash 代理设置在 中/etc/splash/proxy-profiles,但是如果你在容器中运行 splash,你可以通过 将主机代理配置文件映射到容器-v,例如:

sudo docker run -p 8050:8050 -v /etc/splash/proxy-profiles:/etc/splash/proxy-profiles scrapinghub/splash

其次,通过splash访问url时,如果proxy profile name不是,则需要proxy参数default.ini,例如:

localhost:8050/render.html?url=http://target.com?wait=1&timeout=2&proxy=filename
于 2017-11-08T05:49:27.070 回答