我正在尝试使用selenium和python自动访问网站。该网站具有证书认证系统,我必须单击“确定”进入该网站。我无法单击那里的“确定”按钮。
我已经尝试了诸如pyrobot,autoit,pyautogui等之类的东西,但是我无法单击“确定”按钮。当我尝试打开此特定网站时,光标不会移动。
这里是示例代码:
from selenium import webdriver
import pyautogui
driver = webdriver.Chrome(executable_path="C:\\chromedriver_win32\\chromedriver.exe")
driver.get("URL")
pyautogui.click(x=870, y=450, button='left')
尝试类似的事情
from selenium.webdriver.support import expected_conditions as ec
WebDriverWait(webdriver, 10).until(ec.alert_is_present(), "Check for alert")
alert = webdriver.switch_to.alert
alert.dismiss()
或
alert = webdriver.switch_to.alert
alert.accept()