Since yesterday I have been trying in Python, with Selenium, to create a bot that allows voting a poll. The process from the beginning of the session until the vote is done perfectly, but when I indicate the xPath of the option to vote, it does not detect it and the bot is closed. I tried to externalize the frame in another tab, but on the one hand we have the same error, and on the other, it seems that the survey works by Tokens, that is, even if it is accessed from the same user, the link to the frame expires when close and open again.
I leave the extract of the code where I miss the error in case someone can light me a little. Greetings.
#Bot entra a encuesta
#entrar encuesta
driver.get("https://twitter.com/majeflomon/status/988357553007550465")
print("----Accediendo a encuesta")
time.sleep(2)
#votar encuesta
button_opc = driver.find_element_by_xpath("/html/body/div/div/div/div/div[2]/label/span[2]")
button_opc.click()
print("----Opcion Marcada (NO)")
#enviar voto
button_env = driver.find_element_by_xpath("/html/body/div/div/div/div/div[4]/div/span[1]")
button_env.click()
print("----Votacion Realizada")