Estou programando um boot que interaja com uma página do google (google meet) para isso estou o selenium, mas quando uso o comando de find_element
no python ele da o seguinte erro:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[1]/div[3]/div/div[2]/div[3]/div/span/span"}
provavelmente não é erro da página ainda não ter carregado porque coloquei um sleep de 20 segundos
aqui o meu codigo:
import os
from datetime import date
from datetime import datetime
from time import sleep
import selenium
from selenium import webdriver
hora = 360
driver = selenium.webdriver.Chrome(r"C:\Users\adelson\Desktop\chromedriver")
def segunda():
if now.hour == 21:
os.startfile('link da reunião')
sleep(20)
my_button = driver.find_element_by_xpath("/html/body/div[1]/div[3]/div/div[2]/div[3]/div/span/span")
my_button.click()
sleep(hora)
while True:
now = datetime.now()
data = date(now.year, now.month, now.day)
#segunda
if data.isoweekday() == 1:
segunda()
sleep(120)