1

Using Selenium I am accessing protected pages. I need to put the credentials into the URL to prevent the .htaccess popup from appearing. This is the method suggested in Selenium documentation.

One of the locations I need to access has a hash character in the password, and this causes the browser (both Chrome and Firefox) to not understand the URL and treat it as a search term.

e.g. http://user:pass@example.com/ gets through, but http://user:pa#ss@example.com/ is not recognised as a URL.

How can I "encode" the hash?

Synesso
  • 37,610
  • 35
  • 136
  • 207

1 Answers1

2

You should use Percent-encoding to encode the hash with %23.

See also:

Community
  • 1
  • 1
alecxe
  • 462,703
  • 120
  • 1,088
  • 1,195