php - Can DOMPath be used to get javascript variables inside HTML document? -


i want javascript variable printed out in html code using domxpath,here html code

<body>     <div></div> <body> <script>   var $data = {"employees":[ {"firstname":"john", "lastname":"doe"}, {"firstname":"anna", "lastname":"smith"}, {"firstname":"peter", "lastname":"jones"} ]}; </script> 

by using domxpath can access every element inside body tag, how can deal javascript variable, seems not a node, can domxpath deal such situation, or have use other approaches such regex?

this html i'm getting data not own server, need scrape , store on local machine.


Comments