我在 Windows 7 机器上有以下简单的 casperjs 脚本(我无法命名实际的 URL - 抱歉):
var casper = require('casper').create({verbose:true,logLevel: "debug"});
casper.start('https://[XXX].de', function() {
console.log(this.getCurrentUrl());
});
casper.run();
输出表明它失败了 - 当前的 url 是:“about:blank”
[info] [phantom] Starting...
[info] [phantom] Running suite: 2 steps
[debug] [phantom] opening url: https://[XXX].de, HTTP GET
[debug] [phantom] Navigation requested: url=https://[XXX].de, type=Other, lock=true, isMainFrame=true
[warning] [phantom] Loading resource failed with status=fail: https://[XXX].de
[debug] [phantom] Successfully injected Casper client-side utilities
about:blank
[info] [phantom] Step 2/2: done in 39205ms.
[info] [phantom] Done 2 steps in 39309ms
当使用 Firefox RESTCLient 插件发送 GET 请求时 - 我得到:
Status Code: 200 OK
Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0
Connection: close
Content-Type: text/html
Date: Tue, 11 Dec 2012 11:09:37 GMT
Expires: Thu, 19 Nov 1981 08:52:00 GMT
Pragma: no-cache
Server: unknown
Transfer-Encoding: chunked
我的问题是:
我该如何调试呢?这是一个已知的问题 ?