There is a waitForUrl()
functionality in Casper.js
, but is it possible to waitForUrlChange()
in Casper.js
?
I mean detecting a change in this.getCurrentUrl()
value. I can't predict the new url value. It can be anything.
There's an event handler for it
casper.on('url.changed',function(url) {
casper.echo(url);
});
Here's the documentation for it: http://casperjs.readthedocs.org/en/latest/events-filters.html#url-changed
However, as Artjom B. mentioned, this won't cover all cases that a function extension would handle. It's only really appropriate when you don't need it as part of the control flow, but just want to reactively scrape some values when it happens.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With