I'm using CasperJS to read a certain web page. What I want to do is load a web page in CasperJS. Then, wait for a certain HTML element to have a specific text.
So what I'd LIKE to do is this:
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'd like to use waitForText
, but with a CSS
selector. So that it can monitor a piece of text in a certaim HTML element. It's not really obvious to me if and how this is possible.
Can this be done in CasperJS? If so, how can I do that?