https://www.expedia.co.jp/service/
こちらのサイトのQ&A情報を取得したいのですが、Q&A本文の情報が取得できません。
以下のjavascriptコードを利用しcasperjsを利用してQ&Aの本文を取得したいのですが、PCにて表示時の左側メニューはキャプチャ結果にて確認できるのですが、本文を確認することが出来ません。
環境はMac OSです。
実行時コマンドは casperjs ./sample.js です。
ご見識のある方、是非ともご教授願えたらと思います。
宜しくお願い致します。
var casper = require('casper').create({ viewportSize: { width: 1920, height: 1024} }); casper.userAgent('Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X) AppleWebKit/537.51.1 (KHTML, like Gecko) Version/7.0 Mobile/11A465 Safari/9537.53'); var url = 'https://www.expedia.co.jp/service/#/myTrips/13047'; casper.start(url, function() { // this.test.assertExists(x('//li[@id="result-410"]'), 'the element exists'); this.then(function(){ this.mouse.click('#result-410'); }); this.then(function(){ this.wait(1000); }); this.then(function(){ this.capture('expedia.png', { top: 0, left: 0, width: 1920, height: 1024 }); }); }); //開始 casper.then(function() { console.log('clicked ok, new location is ' + this.getCurrentUrl()); }); jsコード
回答1件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2017/09/05 09:22