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

216
Vistas
Trying to remove html readonly attribute using python

I'm trying to remove readonly tag from an input field by using python and selenium. Can anybody help me here?

Datepicker Image:

date

HTML:

<input id="startDate" name="START_DATE" type="text" class="date hasDatepicker" readonly="readonly">

Code I've tried :

driver.execute_script('driver.find_element_by_xpath('"+//*[@id = '"+'startDate'+"']+"').removeAttribute("readonly")')
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

To remove the readonly attribute you need to use removeAttribute() as follows:

element = driver.find_element(By.XPATH, "//input[@class='date hasDatepicker' and @id='startDate']")
driver.execute_script("arguments[0].removeAttribute('readonly')", element)

References

You can find a couple of relevant detailed discussions in:

  • How to Change a html line code with python
  • How to click on date in zebra datepicker in html?
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