我有我的網站的網址,我正在做它與casperjs.I我想要獲得標題和測試類或id在這個頁面中有問題,並將值設置爲通過使用casperjs在本網站的文本框。在Casperjs使用URL Proplem
//var url = 'https://www.google.com.kh/';
//this url below it is not work with my code if the url above it work normal
var url = 'https://teleservices.paris.fr/etatcivil/jsp/site/RunStandaloneApp.jsp?page=formengine&form=naissance';
var casper = require('casper').create();
casper.start(url, function() {
this.echo(url);
this.echo("start page...");
});
casper.then(function(){
this.wait(1000,function(){
this.echo('Page: ' + this.getTitle());
});
}),
casper.then(function() {
if(this.exists("div.job-search-box-text")){
this.echo("this is id found");
}
else{
this.echo("no ID found");
}
}),
casper.then(function(){
this.wait(1000,function(){
this.fillSelectors('form', {
'input[name="title"]' : "12"
});
this.capture('result.png');
});
});
casper.run();
我有這個網址的問題,當我設置var url = 'https://teleservices.paris.fr/etatcivil/jsp/site/RunStandaloneApp.jsp?page=formengine&form=naissance'; my result code can not display the title of the web page,can not get the each id or class in this webpage,can not capture....I'm stuck with this anyone have solution , I have tried it for long time,please help me, thanks.
TypeError是因爲fillSelectors是在Casper 1.1中引入的http://docs.casperjs.org/en/latest/modules/casper.html#fillselectors – emgee