2017-06-12 19 views
1

私はcasperjsを使用しています。リンクがあり、各ページを開いていました。配列のサイクルは常にhttp://finishline.com/に停止しました。私は何の反応も得られないようです。私はちょうどそのリンクから情報を得ることができない状況を分離した。URLにナビゲートしても応答は得られません

それだけで停止します。

... [情報] [ファントム]実行スイート:2は、手順 [デバッグ] [ファントム]開くURL:http://finishline.com/、HTTP GET [デバッグ] [ファントム]ナビゲーションは、要求:URL = http://finishline.com/、=他のタイプを、 willNavigate =真、isMainFrame = trueを [デバッグ] [ファントム]ナビゲーション要求:URL = http://www.finishline.com/、タイプ= 0番目 えー、willNavigate =真、isMainFrame =真

ここ

は、分離コードです:

var casper = require("casper").create({ 
    verbose : true, 
    logLevel : "debug", 
    pageSettings: { 
     userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.106 Safari/537.36", 
     customHeaders: { 
      "Server": "Apache/2.4.1 (Unix)" 
     } 
    }, 
    clientScripts: ["jquery.js"] , 
    viewportSize: { 
     width: 1920, 
     height: 1080 
    } 
}); 

casper.start().thenOpen("http://finishline.com") 
.then(function(){ 
    console.log("title : ", this.getTitle()) 
}) 
casper.run(); 

は、なぜ私がフィニッシュ・ラインからの応答を取得こすったりすることはできませんか?

応答がない場合、コードを続行するための応答が得られない場合の対処方法を教えてください。

+0

困ったことに、なぜ実際には応答ヘッダーと思われるこれらのカスタムヘッダーを送信しますか? – Vaviloff

答えて

0

私はSlimerjsを使用してコードを実行しました:

casperjs --engine=slimerjs my_casper_script.js 

をそして、それは問題なく走っ:

[info] [phantom] Starting... 
[info] [phantom] Running suite: 2 steps 
[debug] [phantom] opening url: http://finishline.com/, HTTP GET 
[debug] [phantom] Navigation requested: url=http://finishline.com/, type=Undefined, willNavigate=true, isMainFrame=true 
[debug] [phantom] url changed to "http://www.finishline.com/" 
[debug] [phantom] Navigation requested: url=https://a7474150781.cdn.optimizely.com/client_storage/a7474150781.html, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=https://a7474150781.cdn.optimizely.com/client_storage/a7474150781.html, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=https://cdns.us1.gigya.com/gs/webSdk/Api.aspx?apiKey=3_wvYmaqsebd4zKyXKtXex5iT6qVdAQNm8T5Vjh1LhGavP4EApJp4T5CcdKuXozmAe#origin=http://www.finishline.com/&hasGmid=false, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=https://cdns.us1.gigya.com/gs/webSdk/Api.aspx?apiKey=3_wvYmaqsebd4zKyXKtXex5iT6qVdAQNm8T5Vjh1LhGavP4EApJp4T5CcdKuXozmAe#origin=http://www.finishline.com/&hasGmid=false, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=https://4978775.fls.doubleclick.net/activityi;src=4978775;type=aa;cat=links00;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;&ord=0.17442537640363165, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=https://4978775.fls.doubleclick.net/activityi;src=4978775;type=aa;cat=links00;dc_lat=;dc_rdid=;tag_for_child_directed_treatment=;&ord=0.17442537640363165, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=http://login.dotomi.com/ucm/UCMController?dtm_com=28&dtm_fid=101&dtm_cid=61247&dtm_cmagic=963c2b&dtm_format=5&cli_promo_id=1&dtm_user_id=o867995714&dtmc_ref=&dtmc_loc=http%3A//www.finishline.com/&dtm_user_token=, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=http://login.dotomi.com/ucm/UCMController?dtm_com=28&dtm_fid=101&dtm_cid=61247&dtm_cmagic=963c2b&dtm_format=5&cli_promo_id=1&dtm_user_id=o867995714&dtmc_ref=&dtmc_loc=http%3A//www.finishline.com/&dtm_user_token=, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=https://20725988p.rfihub.com/ca.html?rfiidc=1048283195230333342&rfiaid=8c49df89b5394c92b2630ec07269f9c3&ver=9&rb=24949&ca=20725988&_o=24949&_t=20725988&pe=https%3A%2F%2F4978775.fls.doubleclick.net%2Factivityi%3Bdc_pre%3DCPyZuc2nuNQCFXah7Qod9IsPqg%3Bsrc%3D4978775%3Btype%3Daa%3Bcat%3Dlinks00%3Bdc_lat%3D%3Bdc_rdid%3D%3Btag_for_child_directed_treatment%3D%3B%26ord%3D0.17442537640363165&pf=http%3A%2F%2Fwww.finishline.com%2F&ra=82836050341159, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=https://20725988p.rfihub.com/ca.html?rfiidc=1048283195230333342&rfiaid=8c49df89b5394c92b2630ec07269f9c3&ver=9&rb=24949&ca=20725988&_o=24949&_t=20725988&pe=https%3A%2F%2F4978775.fls.doubleclick.net%2Factivityi%3Bdc_pre%3DCPyZuc2nuNQCFXah7Qod9IsPqg%3Bsrc%3D4978775%3Btype%3Daa%3Bcat%3Dlinks00%3Bdc_lat%3D%3Bdc_rdid%3D%3Btag_for_child_directed_treatment%3D%3B%26ord%3D0.17442537640363165&pf=http%3A%2F%2Fwww.finishline.com%2F&ra=82836050341159, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=http://dis.us.criteo.com/dis/dis.aspx?p=3616&cb=23181624377&ref=&sc_r=1280x1024&sc_d=24, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Navigation requested: url=http://dis.us.criteo.com/dis/dis.aspx?p=3616&cb=23181624377&ref=&sc_r=1280x1024&sc_d=24, type=Undefined, willNavigate=true, isMainFrame=false 
[debug] [phantom] Automatically injected jquery.js client side 
[debug] [phantom] Successfully injected Casper client-side utilities 
[info] [phantom] Step anonymous 2/2 http://www.finishline.com/ (HTTP 301) 
title : Finish Line: Shoes, Sneakers & Athletic Gear 
[info] [phantom] Step anonymous 2/2: done in 7686ms. 
[info] [phantom] Done 2 steps in 7694ms 

私はあなたと同じ結果を得たエンジンとしてphantomjsを使用してコードを実行したとき。 slimerjsのインストール方法はhereです。 npmがインストールされている場合は、このコマンドでインストールできます。

npm install slimerjs -g 

これは何らかの援助です。

+0

私はチャンスがあるときにこれをテストします。あなたのご意見ありがとうございます。 –

+0

ああ、あなたがUbuntuを使っているのなら、私はcasperjs、slimerjs、phantomjs、そして必要なグラフィカルエンジンのインストールを自動化するbashスクリプトを書いて、slimerjsを完全に無人にすることができます[ここ](https://github.com/) barthskywalker/Casperjs-install-for-Ubuntu) –

関連する問題