bruce
unread,Jun 13, 2017, 1:25:08 PM6/13/17Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Sign in to report message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to casp...@googlegroups.com
Hey/Hi.
Testing out some very simple casperjs/phantomjs.
I basically, get a list of urls ,and do a simple fetch.. nothing complex.
However, in my test, once I get the url/content, I then invoke a
function "processPage" in this case, and I'd like to pass a variable
to it!! Should be quite simple, but I haven't run across how to do it.
Also need to know the child syntax for the "processPage" function..
Any examples/pointers/comments would be helpful.
Thanks much!
-------------------------
var processPage = function() { <<<<<
this.echo(this.page.content);
this.echo("bbbbbbb");
};
t=0;
//--test loop iteration
casper.then(function() {
// loop on array
casper.each(links, function(casper,link) {
t++;
dd=id[t];
casper.echo(link);
casper.echo("as");
//exit();
//casper.thenOpen(url1).waitForSelector(x("//a[contains(@href,
'securex')]"), processPage, <<<
casper.thenOpen(link).waitForSelector(x("//a[contains(@href,
'securex')]"), processPage,
function fail() {
console.log("oops11");
}
);
//--for the "this.thenOpen"
//casper.exit();
//this.exit();
//exit();
//casper.exit();