Olá, comecei a estudar Python a pouco e estou fazendo alguns testes com selenium e me deparei com um erro no qual não estou sabendo resolver. Estou tentando clicar em um botão em um site porém aparece o seguinte erro:
selenium.common.exceptions.NoSuchElementException: Message: no such element: Unable to locate element: {"method":"xpath","selector":"/html/body/div[3]/div[2]/div[1]/div[1]/div/a"}
(Session info: chrome=87.0.4280.88)
Segue código abaixo:
from selenium import webdriver
chromedriver = "chromedriver"
driver = webdriver.Chrome(chromedriver)
url = 'https://pt.stackoverflow.com/'
driver.get(url)
driver.find_element_by_xpath("/html/body/div[3]/div[2]/div[1]/div[1]/div/a").click()
find_element_by_id
. Será que é possível neste caso?