使用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 (将#修改为@)