Evaluating Remote Javascript with CasperJs
I needed to retrieve evaluated Javascript object from a remote page. The code on the page looked like this:
<script language="Javascript" type="text/javascript">
var XXXGen = function(options){
!options && (options = {});
this.url = '';
this.options = options;
....
};
...
var gen = new XXXGen({
trackuri: 'some.uri',
campaignId: 000000,
programs: [{"key":"123","value":"345"}, {.....}]
});