Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

245
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda