PhantomJS evaluate with basic auth returning null

后端 未结 2 1861
旧时难觅i
旧时难觅i 2021-01-25 10:04

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

相关标签:
2条回答
  • 2021-01-25 10:35

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

    0 讨论(0)
  • 2021-01-25 10:45

    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.

    0 讨论(0)
提交回复
热议问题