javascript - Merge 2 JSON dumps into one (CasperJS) -


i'm using casperjs , i'd 1 json result.

this part of js :

casper.then(function () {     require('utils').dump(this.getelementsinfo('h1'));     this.waitforselector('video', function () {         require('utils').dump(this.getelementsinfo('.qual'));     });     this.screenshot('ololo'); }); 

i'm getting 2 json "dump" i'd 1 json inside.

since casper.getelementsinfo produces objects have same properties, wouldn't make sense integrate 1 object another, because properties overwritten. can make object contains sub-objects:

casper.then(function () {     var h1 = this.getelementsinfo('h1');     this.waitforselector('video', function () {         var qual = this.getelementsinfo('.qual');         require('utils').dump({             h1: h1,             qual: qual         });     });     this.screenshot('ololo'); }); 

Comments

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -