I'm new to Javascript and PhantomJS, but my seemly simple objective has proven to be harder to achieve than expected. I want to write a script that would load a website, and then output the value of a Javascript variable used on that page. If I open that page in a browser and open the Javascript console, I can type in the variable name and it tells me the value associated to said variable. I just trying to reproduce this function but with PhantomJS so that I can automate this task.
Could someone point me towards the right documentation for this? I haven't been able to find how to do such a thing, assuming PhantomJS is the right way to do this. Maybe there is a simpler alternative?
Thanks.