我在使用Scrapy-Splash和HTTP proxy (参见"500 Internal Server Error" when combining Scrapy over Splash with an HTTP proxy)时遇到了一些问题,即使我试图在http://splash.readthedocs.io/en/latest/api.html#proxy-profiles之后设置一个代理配置文件。
为了更好地理解发生了什么,我正在寻找Scrapy-Splash源代码的一部分,https://github.com/scrapy-plugins/scrapy-splash,它解析/etc/splash/proxy-profiles中的.ini文件中指定的代理host和port。
然而,在存储库中搜索"proxy“或".ini”没有得到任何结果。有人能给我解释一下代理分析是如何在Scrapy-Splash中实现的吗?
发布于 2017-11-08 13:49:27
首先,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名称不是default.ini,则需要一个proxy参数,例如:
localhost:8050/render.html?url=http://target.com?wait=1&timeout=2&proxy=filenamehttps://stackoverflow.com/questions/45076817
复制相似问题