簡體   English   中英

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

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

使用phantomjs版本2.1.1的/ opt / casperjs中的CasperJS版本1.1.4。 在centOS上運行。

試圖通過在ASP.net Webforms上運行的身份驗證頁面,但是在提交按鈕之后單擊:

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計算機上運行。

聚苯乙烯

一年多沒事...

如上所述,該平台是centOS。 這很有趣,但是...

sudo yum update

然后:

sudo reboot

任務完成。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM