Scrapy Splash服务器无法通过docker run启动

时间:2016-05-08 17:49:38

标签: python docker scrapy

根据alexce的说明here安装了docker,scrapyjs和splash。

然后,运行docker run -p 8050:8050 scrapinghub/splash,我得到了这个输出:

2016-05-08 17:17:45+0000 [-] Log opened.
2016-05-08 17:17:45.978866 [-] Splash version: 2.1
2016-05-08 17:17:45.979553 [-] Qt 5.5.1, PyQt 5.5.1, WebKit 538.1, sip 4.17, Twisted 16.1.1, Lua 5.2
2016-05-08 17:17:45.980138 [-] Python 3.4.3 (default, Oct 14 2015, 20:28:29) [GCC 4.8.4]
2016-05-08 17:17:45.980401 [-] Open files limit: 1048576
2016-05-08 17:17:45.981020 [-] Can't bump open files limit
2016-05-08 17:17:46.086232 [-] Xvfb is started: ['Xvfb', ':1', '-screen', '0', '1024x768x24']
2016-05-08 17:17:46.161902 [-] proxy profiles support is enabled, proxy profiles path: /etc/splash/proxy-profiles
2016-05-08 17:17:46.260357 [-] verbosity=1
2016-05-08 17:17:46.260607 [-] slots=50
2016-05-08 17:17:46.261170 [-] argument_cache_max_entries=500
2016-05-08 17:17:46.262476 [-] Web UI: enabled, Lua: enabled (sandbox: enabled)
2016-05-08 17:17:46.264565 [-] Site starting on 8050
2016-05-08 17:17:46.265203 [-] Starting factory <twisted.web.server.Site object at 0x7f270ec81e10>

它挂在那里。我尝试根据说明here(重新安装的docker,验证vm正在运行,重新生成证书,设置env)进行故障排除,但仍然没有。

My settings fileSpider

当在meta= start_requests`中运行没有yield scrapy.Request' call within参数的蜘蛛时,蜘蛛运行良好(除了没有捕获动态字段),所以我不确定这是不是是docker或splash的问题。

提前感谢。

1 个答案:

答案 0 :(得分:2)

当使用Docker运行Splash时,控制台首先只是&#34;挂在那里&#34;,的确如此。 Splash正在通过其中一个端点等待请求。

$ sudo docker run -p 8050:8050 scrapinghub/splash
2016-05-09 10:21:42+0000 [-] Log opened.
2016-05-09 10:21:42.773541 [-] Splash version: 2.1
2016-05-09 10:21:42.774298 [-] Qt 5.5.1, PyQt 5.5.1, WebKit 538.1, sip 4.17, Twisted 16.1.1, Lua 5.2
2016-05-09 10:21:42.774453 [-] Python 3.4.3 (default, Oct 14 2015, 20:28:29) [GCC 4.8.4]
2016-05-09 10:21:42.774632 [-] Open files limit: 1048576
2016-05-09 10:21:42.774842 [-] Can't bump open files limit
2016-05-09 10:21:42.879868 [-] Xvfb is started: ['Xvfb', ':1', '-screen', '0', '1024x768x24']
2016-05-09 10:21:43.072351 [-] proxy profiles support is enabled, proxy profiles path: /etc/splash/proxy-profiles
2016-05-09 10:21:43.214478 [-] verbosity=1
2016-05-09 10:21:43.214617 [-] slots=50
2016-05-09 10:21:43.214703 [-] argument_cache_max_entries=500
2016-05-09 10:21:43.215195 [-] Web UI: enabled, Lua: enabled (sandbox: enabled)
2016-05-09 10:21:43.217494 [-] Site starting on 8050
2016-05-09 10:21:43.217635 [-] Starting factory <twisted.web.server.Site object at 0x7f529d0fee48>

要测试Splash是否正常运行,请在http://localhost:8050/

尝试其网络用户界面

您应该看到类似的内容:

enter image description here

然后,您可以尝试输入一些网址,然后点击&#34;渲染我!&#34;