I'm trying to use CasperJS' click()
to follow a link which generates a modal on the current screen. When I query the proper selector and click it in the browser console using document.querySelector().click()
it works, but even when I casper.evaluate()
this it doesn't work. I found someone who had a very similar problem, but his question remains unanswered, and I am experiencing almost identical problems. casperjs button click doesn't navigate to next page
the code I'm currently using is
this.waitForSelector('div.talk-sharing__tools a.rate-button', function() {
this.then(function() {
this.evaluate(function() {
document.querySelector('a.rate-button').click();
});
the page I'm trying to scrape is http://www.ted.com/talks/uri_alon_why_truly_innovative_science_demands_a_leap_into_the_unknown