Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

319
Vistas
How do I get a popup validation message from a page using selenium Python?

How do I get the popup validation message "Please tick this box if you want to continue" using Selenium Python in the photo?

<input oninvalid="this.setCustomValidity('Please tick this box if you want to proceed')" oninput="this.setCustomValidity('')" class="form-check-input checkbox-switch-md" type="checkbox" id="registerTermsCheckboxId" required="">
enter image description here

Screenshot

about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Try the below, I hope this will solve your issue.

from selenium import webdriver
from selenium.webdriver import ActionChains
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait


toolTip = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'registerTermsCheckboxId')))
hov = ActionChains(driver).move_to_element(toolTip)
txt = hov.perform()
tooltipText = WebDriverWait(driver, 10).until(EC.presence_of_element_located((By.ID, 'registerTermsCheckboxId'))).text
print(tooltipText)
about 4 years ago · Juan Pablo Isaza Denunciar

0

Found a solution to the problem, where I was able to extract the text in the validation message with the following JavaScriptExecutor code:

message_element = driver.find_element(By.XPATH, Locators.acceptCheckButton_xpath)
accept_button_message = driver.execute_script("return arguments[0].validationMessage", message_element)
print("Message : ", accept_button_message)
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda