CasperJS 已被重定向,然后以 status=fail (HTTP 302) 退出

CasperJS has been redirected and then exited with status=fail (HTTP 302)

CasperJS 版本 1.1.4 在 /opt/casperjs,使用 phantomjs 版本 2.1.1。 运行 在 centOS 上。

正在尝试通过 运行 在 ASP.net 网络表单上的身份验证页面,但在单击提交按钮后:

casper.then(function(){
if (this.exists("#LoginTyreLink_LoginButton")) {
    this.echo("Login button found");
    this.click("#LoginTyreLink_LoginButton", function(){
        saveShot("login_button_clicked");
    });
}
});

我收到重定向周期和超时:

[debug] [phantom] Mouse event 'mouseup' on selector: #Loginsite_LoginButton
[debug] [phantom] Mouse event 'click' on selector: #Loginsite_LoginButton
[info] [phantom] Step anonymous 14/17: done in 3131ms.
[info] [phantom] Step _step 15/17 https://site.brand.eu/link/ (HTTP 200)
[info] [phantom] Step _step 15/17: done in 3155ms.
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Homepage.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Login.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link//Homepage.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Login.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Homepage.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Login.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Homepage.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Login.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Homepage.aspx, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] Navigation requested: url=https://site.brand.eu/link/Login.aspx, type=Other, willNavigate=true, isMainFrame=true
[warning] [phantom] Loading resource failed with status=fail (HTTP 302): https://site.brand.eu/link/Login.aspx
[debug] [phantom] Automatically injected includes/jquery-3.3.1.js client side
[warning] [phantom] Casper.waitFor() timeout
[error] [phantom] Wait timeout of 20000ms expired, exiting.
Wait timeout of 20000ms expired, exiting.
[debug] [phantom] Navigation requested: url=about:blank, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "about:blank"

我已经尝试 运行 我本地机器上的脚本 - 它成功了,但不能在我的远程 centOS 机器上。

P.S.

一年多没问题...

正如我上面提到的——平台是centOS。 这很有趣但是...

sudo yum update

然后:

sudo reboot

任务完成。