Extract data from javascript objects

Most sites are built using javascript frameworks these days, and returning data that exists in the DOM would be very useful. Particularly raw data for a chart, which is contained in a deep object. This one command would solve my problem. Can you add a "selector" that will allow me to add a javascript function that returns a string to be stored as a column?

JSON.stringify(Highcharts.charts[0].series[0].data.map((e)=>{return {x: e.x,y: e.y}}))