phantom.casperTest = true;
phantom.outputEncoding="utf-8"; 
var casper = require('casper').create({

// pageSettings: {
// loadImages: true,
// loadPlugins: false
// },
logLevel: "info",
verbose: false
});
var fs=require('fs');
casper.start('http://js.studio-kingdom.com/javascript/element/get_attribute', function() {
});
casper.then(function(){
this.wait(5000, function() {
var url= this.evaluate(function() {
//	return document.querySelector('li[class="nav-header"]').innerHTML; 
return __utils__.getElementByXPath('//li[@class="nav-header"]').innerText; 
});
this.echo(url);
});
});
//casper.then(function() {
//this.capture('baiduSearch.png');
//});

casper.run();

  

相关文章:

  • 2021-07-31
  • 2021-09-29
猜你喜欢
  • 2021-07-01
  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2021-06-06
  • 2021-04-14
相关资源
相似解决方案