Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

212
Views
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 answers
Answer question

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!