1

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.

mattmattmatt
  • 965
  • 3
  • 15
  • 29
  • 1
    A comment from [@KevinGagnon](http://stackoverflow.com/users/4962411/kevin-gagnon) who can't post a comment so posted an answer instead): "*Can we see the event code ?*". – Wai Ha Lee Dec 14 '15 at 20:48

0 Answers0