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

242
Views
Selenium, WebDriver: Obtener elemento, " <a href=Javascript " con variables cambiantes

fuente del botón javascript para obtener el elemento:

 <a href="JavaScript:onclick=bookProsecc('20220512','1550','A','B','0','','')"> <img src="/image/cal_app.jpg" alt="C"> </a>

Usé find_element usando href justo antes de cambiar las variables, pero creo que no funciona.

 submit_btn = driver.find_element(By.XPATH,"//a[@href='JavaScript:onclick=bookProsecc(']")

¿Cuál es la mejor manera de acceder al elemento del botón?

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

Probar:

 submit_btn = driver.find_element(By.XPATH,"//img[@src='/image/cal_app.jpg']/..")
about 4 years ago · Juan Pablo Isaza Report

0

submit_btn = driver.find_element(By.XPATH,"//a[starts-with(@href,'JavaScript:onclick=bookProsecc(')]")

Pruebe este en el que href comienza con una determinada cadena.

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!