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

247
Visualizações
Im trying to automate a login on a page using puppeteer, once I login on the next page I want to click a button which is present on the next page

To perform automation on the next page do I have to write some different code in a different function as the URL changes after logging in also the button which I'm trying to click on the next page doesn't have any ID or CLASS. Here is the button which im trying to select:

<div class="BenchTool NewEnquiry Orange" data-bind="click: Logic.Enquiry.NewEnquiry">
                    <div>&nbsp;</div>
                    <span>New Enquiry</span>
                </div>

Here is the code which I have written in puppeteer

const puppeteer = require("puppeteer");

async function main () {
    const browser = await puppeteer.launch({
        headless: false
    });
const page = await browser.newPage();
await page.goto("https://onecall.linesearchbeforeudig.co.uk/uk-b4-en/Account/Login?returnUrl=%2Fuk-b4-en%2FWorkBench");
await page.$eval('input[name=emailOrUserName]', el => el.value = 'Pramod Rai');
await page.$eval('input[name=password]', el => el.value = '******');
await page.click('#acceptTermsAndConditions');
await page.click('#login-submit');
}; 
main();

Im able to login using this code but not able to click the button on the next page, I tried pressing Enter that doesn't work, also tried clicking it based on Co-ordinates but that doesn't seem to work as well; any help will be appreciated. Thanks!

about 4 years ago · Juan Pablo Isaza
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