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

293
Vistas
I cannot submit a form neither using .click() nor using .submit()

In an external webpage that I do not administrate, I have to fill a form that has no id or name. The "submit" button code looks like this:

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

At first I tried a simple click like this:

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

The button was clicked but it did not trigger the submition of the form (I also tried using "Enter" with the keyboard, but the result is the same).

Then, I tried to trigger the submit from the own form like this:

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

})

and like this:

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

})

and also like this:

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

})

In all the three cases the result is an error in the page.

What should I do? Thanks in advance.

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

See that in your JS code you don't have this:

e.preventDefault();

if you have this code then it will prevent the form to be submitted.

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