Skip to content Skip to sidebar Skip to footer

Phantomjs Evaluate With Basic Auth Returning Null

I am trying to use PhantomJS on a page with basic always auth, for example, this page http://alexturpin.net/auth (test:rosebud) Using the following code var webpage = require('webp

Solution 1:

With that syntax you are wiping out the settings object, replacing it with only userName and password. Use that code to set them:

page.settings.userName = "test";page.settings.password = "rosebud";

Probably PhantomJS should handle that better, i.e. not rely on the settings object for defaults.

Solution 2:

This is a closure issue, try to put your console.log in a callback

Post a Comment for "Phantomjs Evaluate With Basic Auth Returning Null"