I am using PhantomJS to make calls to a web page, like this:
page.open('http://example.com', function (s) {
console.log(page.content);
phantom.exit();
});
I am using this in the context of Drupal Simpletests, which require me to set a special USERAGENT in order to use the test database instead of the real database. I would like to fetch the web page a specific user agent. For example, in PHP with Curl, I can do this with CURLOPT_USERAGENT before making a cUrl call.
Thanks!
Albert