0

I'm trying to log to a local site using chrome using selenium and python. I've tried using:

driver.get('user.name:!#$EDCzzzzzzzz@http://localhost/');

but whenever I do that I get warning that my url is in invalid format. I suppose it has to do with the way that passoword is (has !@#$ in it etc.) I cannot change that password. Any ideas? Is there a way to target chrome dialog popup with xpath? What should I look for as a solution.

Gaurang Shah
  • 11,764
  • 9
  • 74
  • 137
phoez
  • 43
  • 7
  • you can try with the format http: //username:pwd@localhost/ – Murthi Jul 24 '17 at 13:04
  • Still same error, "Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Cannot navigate to invalid URL"} (Session info: chrome=59.0.3071.115) (Driver info: chromedriver=2.30.477700 (-),platform=Windows NT 10.0.14393 x86_64)" – phoez Jul 24 '17 at 13:06
  • Instead of localhost, you try with your machine ip address – Murthi Jul 24 '17 at 13:14
  • still same error, I think it has to do with password having other symbols than just letters, or maybe that username is divided with dot – phoez Jul 24 '17 at 13:27
  • 1
    I tried your code locally under python 2 and python 3, it works just fine `from selenium import webdriver driver = webdriver.Chrome() driver.get('user.name:!#$EDCzzzzzzzz@http://localhost/'); ` You could be right that the problem is related to the special characters. Try encoding your url, or just parts of it (username + password + @(?)). Here's the [RFC](https://tools.ietf.org/html/rfc3986#section-3.2.1) for url, directly to user information. – Chabare Jul 24 '17 at 13:29
  • If you are using the latest version of chromedriver, then this format is not supported. [check this](https://github.com/seleniumhq/selenium-google-code-issue-archive/issues/34#c32) – Gokul Jul 25 '17 at 04:30
  • These might help [this](https://stackoverflow.com/questions/5672407/how-to-perform-basic-authentication-for-firefoxdriver-chromedriver-and-iedriver) [this](https://stackoverflow.com/questions/9888323/how-to-override-basic-authentication-in-selenium2-with-java-using-chrome-driver). Also, these are not for Python. – Gokul Jul 25 '17 at 04:34
  • I've managed to fix my issue by converting manually password to urlencoded text – phoez Jul 25 '17 at 13:10

0 Answers0