ajax - CasperJS: capturing JSON sent response to javascript onClick() -


in casperjs, working site has button this:

<a id="showbills"     onclick="javascript:{showbills(); return false;}"     href="#">show bills</a> 

clicking generates xmlhttprequest post message massive form full of magic numbers , state. server responds sending json data structure want capture.

in case, can't call casper.getpagecontent() json data, since it's interpreted client , incorporated dom.

nor can call casper.download(...) since can't manually reconstruct form data required post request.

the question

how can 'intercept' json data sent in response onclick()-backed click?

half idea

there may way subvert showbills() method on client, example send json response ordinary page (rather xmlhttprequest). that's beyond understanding of casperjs, phantomjs , http protocols.


Comments

Popular posts from this blog

resizing Telegram inline keyboard -

command line - How can a Python program background itself? -

php - "cURL error 28: Resolving timed out" on Wordpress on Azure App Service on Linux -