I want to get javascript variable printed out in the HTML code using DOMXPath,here is the 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 I can get access to every element inside body tag, but how can I deal with javascript variable, it seems it is not a a node, can DOMXPath deal with such situation, or I have to use other approaches such as Regex?
This HTML I'm getting data from is not from my own server, so I need to scrape it and store it on my local machine.