I'm trying to scrape a page http://www.buddytv.com/trivia/game-of-thrones-trivia.aspx with Phantom.JS
Here's the code:
search = page.evaluate(function() {
return '<div class="question">' + $('#id60questionText').text() + '</div>';
});
results = page.evaluate(function() {
return $('#id78questionRegion').html();
});
answer = page.evaluate(function() {
$('a[href="javascript:___gid_10(0)"]').trigger("click");
return $('body').html();
});
The first two part run without issues, but the last one doesn't. Basically, I want to click on the first answer and return the content of the page that appears once that's been done (and select the answer, but it goes too quickly on the website and I can't check which selector it's in). Anyways, the html returned does not contain the answer and I'm guessing I'm not triggering the click properly. Any advice ?
Thanks a lot, you're all great,