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

242
Vistas
Node.JS Web scraping with Puppeteer failing with error: 'input[value type="email"' is not a valid selector

Basically, i'm trying to log in into this form:

enter image description here

using this script:

const puppeteer = require('puppeteer')
const screenshot = 'carwow.png'

const scrape = async () => {
    const browser = await puppeteer.launch({headless:false});

    const page = await browser.newPage();

    await page.goto('https://dealers.carwow.co.uk/dealers/sign_in')

    await page.type('input type="email"', 'username')
    await page.type('input type="password"', 'password')
    await page.click('name="commit"')

    await page.waitForNavigation()
    await page.screenshot({ path: screenshot })
    browser.close()
    console.log('See screenshot: ' + screenshot)
};


scrape()


However, its failing with an error as such: Error: Evaluation failed: DOMException: Failed to execute 'querySelector' on 'Document': 'input[value type="email"' is not a valid selector.

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

0

I'm not super familiar with puppeteer but it looks like the API you're trying to use, e.g. page.type is documented here: https://github.com/puppeteer/puppeteer/blob/v10.4.0/docs/api.md#pagetypeselector-text-options and it uses CSS selectors for the first argument to test against.

Specifically an attribute selector on an input, here is a short document from W3 on it: https://www.w3schools.com/css/css_attribute_selectors.asp

You may want to try the selector

'input[type="email"]'
about 4 years ago · Juan Pablo Isaza Denunciar

0

@Diego is right. You can rewrite your selector paths as below:

'input[type="email"]' and 'input[type="password"]' and "*[name='commit']"

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