I use CasperJS to read a specific web page. I want to do a webpage loading in CasperJS. Then wait until the specific HTML element has certain text.
So what I would be interested to do:
var casper = require('casper').create(); casper.start('http://www.example.com/somepage', function() { this.echo('Home page opened'); }); // wait for text based on a CSS selector casper.waitForText('.someCssClass', 'dolor sit', function() { this.echo('found title!'); }); // when text is eventually found, then continue with this casper.then(function() { ... } ); casper.run();
So I would like to use waitForText , but with a CSS selector. So that he can track a piece of text in an HTML certaim element. For me, this is not entirely obvious if and how it is possible.
Can this be done in CasperJS? If so, how can I do this?
source share