I' doing this successfully to get the help text of my page of interest.
router.get('/get', function (req, res) {
var pg = 'https://j......com/f/resource'
console.log('get', pg);
requestify.get(pg).then(function (resp) {
console.log(resp.body);
});
});
Now that I have the page's text, I'm wanting to parse the text to get the value of a javascript variable which I know exists in the text.
<script> var x1 = {"p": {.......bla bla ...}};</script>
I know that sometimes the <script> tag will include the type attribute; but it will not always include the type attribute.
When I find the value of x1 I what to use that in my javascript's app's as a value in myVar variable.
If you do not have THE answer then your comment/tip as to what I should research is appreciated.
I was hoping I would find some module I can just drop the entire text into and have the module somehow just output all variables a values for me.
window.x1since you're not competing with funky closures.