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

292
Views
No puedo enviar un formulario ni usando .click() ni usando .submit()

En una página web externa que no administro, tengo que llenar un formulario que no tiene identificación ni nombre. El código del botón "enviar" se ve así:

 <button type="submit" class="sui-AtomButton sui-AtomButton--primary sui-AtomButton--solid sui-AtomButton--center"> <span class="sui-AtomButton-inner">Save</span></button>

Al principio probé un simple clic como este:

 await.page.click('[type="submit"]')

Se hizo clic en el botón pero no provocó el envío del formulario (también intenté usar "Enter" con el teclado, pero el resultado es el mismo).

Luego, traté de activar el envío desde el propio formulario de esta manera:

 await page.evaluate(() => { document.forms[0].submit(); })

y así:

 await page.evaluate(() => { var f = document.forms[0] Object.getPrototypeOf(f).submit.call(f); })

y también así:

 await page.evaluate(() => { document.forms[0].submit(function(event){ event.preventDefault(); }); })

En los tres casos el resultado es un error en la página.

¿Qué tengo que hacer? Gracias por adelantado.

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

0

Mira que en tu código JS no tienes esto:

 e.preventDefault();

si tiene este código, evitará que se envíe el formulario.

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!