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
  • 36,000
  • 33
  • 126
  • 200

1 Answers1

2

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

See also:

Community
  • 1
  • 1
alecxe
  • 441,113
  • 110
  • 1,021
  • 1,148