CasperJS加载资源失败,状态=失败(HTTP 0)

时间:2017-06-13 16:16:51

标签: ssl web-scraping phantomjs web-crawler casperjs

每当我的脚本尝试打开我正在尝试抓取的网站的“创建作业发布”表单时,日志总会产生这样的结果:

[info] [phantom] Step _step 9/18 http://www.samplesite.com/jobs/edit (HTTP 200)
[info] [phantom] Step _step 9/18: done in 12780ms.
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=false
[debug] [phantom] Navigation requested: url=http://www.samplesite.com/jobs/edit, type=Other, willNavigate=true, isMainFrame=false
[warning] [phantom] Loading resource failed with status=fail: http://www.samplesite.com/jobs/edit
[warning] [phantom] Casper.waitFor() timeout
[info] [phantom] Step _step 10/18 http://www.samplesite.com/jobs/edit (HTTP 0)
[info] [phantom] Step _step 10/18: done in 22814ms.
[warning] [phantom] Casper.waitFor() timeout

我试图手动打开网站,但似乎完全没问题。使用CasperJS检查了最后一步的错误截图和HTML脚本,它总是如下所示:enter image description here

我尝试针对此问题的任何解决方法进行一些研究,有些人建议在我的命令中添加--ignore-ssl-errors=true--ssl-protocol=any,但这些不适合我。

在我的JS脚本中,我没有添加任何特殊方法。我只是在打开页面时使用普通casper.click()casper.open()

我正在使用casperjs 1.0.0和phantomjs 2.1.1

0 个答案:

没有答案