Selenium uc,google chrome 无法点击 google meet 中的按钮

问题描述 投票:0回答:1

我想按“不使用麦克风继续”按钮。 无论我如何尝试找到它并按下它,我都找不到:C 我尝试了 Selenium IDE,我设法点击它,但将其转换为 python 代码后,它也不起作用。

screenshot '

from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
import undetected_chromedriver as uc

options = webdriver.ChromeOptions()
options.add_argument('--no-default-browser-check')
options.add_argument('--safebrowsing-disable-download-protection')
options.add_argument('--disable-popup-blocking')
options.add_argument('--disable-web-security')
options.add_argument('--no-sandbox')
#options.add_argument("--disable-infobars")
#options.add_argument("--disable-notifications") #And why is it that if I enable this option,     Google won't let me in at all.
driver = uc.Chrome(options=options)
driver.get('https://meet.google.com/oqm-zoqm-wmx')
try:
    element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.CSS_SELECTOR, ".VfPpkd-ksKsZd-mWPk3d-OWXEXe-Tv8l5d-    lJfZMc > .VfPpkd-vQzf8d"))
    )
    element.click()

except Exception as e:
    print(f"{str(e)}")

finally:
    while True:
        pass

'

python selenium-webdriver automated-tests undetected-chromedriver google-meet
1个回答
0
投票
element = WebDriverWait(driver, 10).until(
        EC.presence_of_element_located((By.XPATH, 
"/html/body/div/div[3]/div[2]/div/div/div/div/div[2]/div/div[2]/button"))
    )
    element.click()

我不知道为什么它突然起作用了......

© www.soinside.com 2019 - 2024. All rights reserved.