1
我嘗試打開使用facebook插件的頁面,但casperJS不加載它。如何使用facebook插件加載頁面?無法用facebook插件打開頁面casperJS
var casper = require("casper").create({
verbose: true,
logLevel: 'debug',
pageSettings: {
userAgent: 'Mozilla/5.0 (Windows NT 6.1; WOW64; rv:17.0) Gecko/20100101 Firefox/17.0'
}
}),
utils = require('utils');
casper.start();
casper.thenOpen('http://bookmate.com', function(response) {
this.echo(this.getTitle());
});
casper.run(function() {
console.log('End');
casper.exit();
});
結果:
[info] [phantom] Starting...
[info] [phantom] Running suite: 2 steps
[debug] [phantom] opening url: http://bookmate.com/, HTTP GET
[debug] [phantom] Navigation requested: url=http://bookmate.com/, type=Other, willNavigate=true, isMainFrame=true
[debug] [phantom] url changed to "http://bookmate.com/"
[debug] [phantom] Navigation requested: url=https://www.facebook.com/plugins/facepile.php?app_id=124791507543584&href=http://facebook.com/bookmate&action=like&width&height=70&max_rows=1&colorscheme=light&size=medium&show_count=true, type=Other, willNavigate=true, isMainFrame=false
我嘗試打開在這裏我們使用Facebook插件的頁面,但casperJS不會加載它。如何使用facebook插件加載頁面?
我試圖中止請求,但它似乎並不工作http://docs.casperjs.org/en/latest/events-filters.html#page-resource-requested –