如何解决使用Python-slenium的VLC身份验证请求
我正在尝试编写代码,以在浏览器中打开vlc网址(http:// localhost:8080),并填写身份验证表单以进入主页,但我在Chrome和Firefox中都不断出错网络驱动 这是代码
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.alert import Alert
from selenium.webdriver.support.ui import WebDriverWait as wait
from selenium.webdriver.support import expected_conditions as EC
chrome_driver = r'C:\chrome_driver_win32\chrome_driver.exe'
driver = webdriver.Chrome(executable_path=chrome_driver)
也可能是driver = webdriver.Firefox(executable_path ='path / to / driver')
driver.get('http://localhost:8080')
wait(driver,5).until(EC.alert_is_present())
alert = driver.switch_to_alert()
alert.send_keys('')
alert.send_keys(Keys.TAB)
alert.send_keys('password')
alert.accept()
使用Firefox会引起:
WebDriverException: Message: User prompt of type promptUserAndPass is not supported
铬提高:
TimeoutException: Message:
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。