大佬教程收集整理的这篇文章主要介绍了Python Windows身份验证用户名和密码不起作用,大佬教程大佬觉得挺不错的,现在分享给大家,也给大家做个参考。
当你一起工作SELEnium 3.4.0,geckodriver v0.18.0,Mozilla firefox 53.0@H_262_4@通过
Python@H_262_4@ 3.6.1可以绕过
Basic Authentication@H_262_4@通过嵌入的弹出
username@H_262_4@和
password@H_262_4@在
url@H_262_4@自身如下。
此解决方案将打开URL http://the-internet.herokuapp.com/basic_auth并使用有效的username和password凭据进行身份验证。
from SELEnium import webdriver
from SELEnium.webdriver.firefox.firefox_binary import firefoxBinary
binary = firefoxBinary('C:\\Program files\\Mozilla firefox\\firefox.exe')
driver = webdriver.firefox(firefox_binary=binary, executable_path="C:\\Utility\\browserDrivers\\geckodriver.exe")
driver.get("http://admin:admin@the-internet.herokuapp.com/basic_auth")
@H_262_4@
正在尝试在提示(URL给定)中输入数据,以下代码给我一个错误。请帮我这些吗?
from SELEnium import webdriver
from SELEnium.webdriver.common.action_chains import ActionChains
from SELEnium.webdriver.common.keys import Keys
import time
driver = webdriver.Firefox()
url = "http://the-internet.herokuapp.com/basic_auth"
driver.get(url)
time.sleep(5)
alert = driver.switch_to.alert
alert.authenticate('admin','admin')
time.sleep(4)
alert.accept()
@H_262_4@
我尝试过:
ActionChains(driver).send_keys("admin").send_keys(Keys.TAB).send_keys("admin").perform()
@H_262_4@
这也是行不通的。
以上是大佬教程为你收集整理的Python Windows身份验证用户名和密码不起作用全部内容,希望文章能够帮你解决Python Windows身份验证用户名和密码不起作用所遇到的程序开发问题。
如果觉得大佬教程网站内容还不错,欢迎将大佬教程推荐给程序员好友。
本图文内容来源于网友网络收集整理提供,作为学习参考使用,版权属于原作者。
如您有任何意见或建议可联系处理。小编QQ:384754419,请注明来意。