Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Nice work!

Can you please provide an example for using `evaluate()` to get the page's content?

I tried this, but didn't get anything:

  new Nightmare()
    .goto('http://yahoo.com')
    .evaluate(function (page) { return this.content; }, function (res) {console.log(res);})
    .run();


extracting stuff seems to be a common use case so added an example to the readme for ya: https://github.com/segmentio/nightmare#examples




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: