Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Status of Phantomjs onResourceReceived Response Body Work

I recently discovered that I cannot read the response body of an ajax request with PhantomJS. Looking into this issue, it appears this has been kicked around for quite some time with no complete resolution. I'm wondering if this capability is not wanted by the PhantomJS project for some reason, possibly resource related.

There are lots of old issues and even an old PR to address this, but it is unclear if this is progressing, stalled, not wanted by the project maintainers, etc... Issue: https://github.com/ariya/phantomjs/issues/10158 PR: https://github.com/ariya/phantomjs/pull/11484

Does anyone know the status of this capability in the PhantomJS project?

like image 653
Alex Grant Avatar asked Oct 20 '22 13:10

Alex Grant


1 Answers

I had this same question, and I discovered that this feature has recently been added to the master branch:

https://github.com/ariya/phantomjs/commit/434d4e0101a540525e8f89a657ea553fb38b040b

As of this writing, you'll need to compile from source (skip the git checkout 2.0 step), as this change hasn't made it into the precompiled binaries.

Note that it'll only capture the body when explicitly requested to do so in the page.captureContent array. For example:

page.captureContent = ['/interestingpage', '/veryinterestingpage'];
like image 91
awm Avatar answered Oct 23 '22 02:10

awm