I am using CasperJS and SpookyJS to navigate to a page, parse the page HTML, and then take some action depending on the HTML of the parsed page.
However, pulling HTML from the page blocks all further spookyInstance.then
calls from executing. However, when I replace the HTML fetching code with any other code, subsequent .then
calls execute without issue.
Current Code:
spookyInstance.then( function () {
// 'getPageContent()' can be replaced with 'getHTML('body'), 'this.page.content' to the same effect
this.emit( 'requestParserReturn', this.getPageContent() );
});
Replacement code that works:
spookyInstance.then( function () {
this.emit( 'requestParserReturn', '<p>arbitrary HTML</p>' );
});
Is there something I'm missing, here? Is there something about interacting with the page HTML itself that prevents further execution?
I'm on the latest SpookyJS (0.2.5) and CapserJS (1.1-beta3). All help would be appreciated.