Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

211
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda