login with username and password by using selenium in python -


software:python 2.7 + selenium browser:chrome 57

hi,

i need download report files website. there os level pop-up window in have input username , password.

enter image description here

i have tried solution input user name , password url link. eg: https://username:password@xxx.com

but not work because username includes "\" translated "/" in url.

and tried download software named autoit, can not install in pc since security issue.

any solutions try issue.

thanks

the easiest way authenticate in case use username , password in url. still can authenticate username "\" symbol, need encode first in url format. example, before forming final url credentials can encode username urllib. code should work in python 2.7:

import urllib  username = "user\\name" password = "password" username_encoded = urllib.quote_plus(username) url = "http://%s:%s@xxx.com" % (username_encoded, password) print(url) 

in output should see:

http://user%5cname:password@xxx.com

and url work fine basic authentication (your case)


Comments

Popular posts from this blog

php - Permission denied. Laravel linux server -

google bigquery - Delta between query execution time and Java query call to finish -

python - Pandas two dataframes multiplication? -