Puppeteer returns an error when I try to go to another url

Viewed 30

I have no idea wtf is happening because I'm just trying to access another url after some element load into the page

So this is the part of my code that's giving me trouble:

page.goto(urlOne);

await Promise.all([
    page.waitForSelector('#email')
]);

await page.type('#email', 'email');
await page.type('#password', 'password');
await page.click('[type="submit"]');

await page.waitForSelector('.Q0LJY');

page.goto(urlTwo)

And catches the error:

                ? new Error(`${response.errorText} at ${url}`)
                  ^

Error: net::ERR_ABORTED at https://.../_mt70c0M at navigate (C:\Users\MTC\Desktop\JS\node_modules\puppeteer\lib\cjs\puppeteer\common\Frame.js:225:23) at processTicksAndRejections (node:internal/process/task_queues:96:5) at async Frame.goto (C:\Users\MTC\Desktop\JS\node_modules\puppeteer\lib\cjs\puppeteer\common\Frame.js:195:21) at async Page.goto (C:\Users\MTC\Desktop\JS\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1155:16)

1 Answers

It seems like your request was aborted. Maybe because the test suite already started to exit. Did you try to add an "await" to your operation? I.e.

await page.goto(urlTwo)
Related