简体   繁体   English

当我尝试将 go 转换为另一个 url 时,Puppeteer 返回错误

[英]Puppeteer returns an error when I try to go to another url

I have no idea wtf is happening because I'm just trying to access another url after some element load into the page我不知道 wtf 正在发生,因为我只是在将一些元素加载到页面后尝试访问另一个 url

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)错误:net::ERR_ABORTED 在 https://.../_mt70c0M 在导航(C:\Users\MTC\Desktop\JS\node_modules\puppeteer\lib\cjs\puppeteer\common\Frame.js:225:23)在 processTicksAndRejections (node:internal/process/task_queues:96:5) 在异步 Frame.goto (C:\Users\MTC\Desktop\JS\node_modules\puppeteer\lib\cjs\puppeteer\common\Frame.js:195: 21) 在异步 Page.goto (C:\Users\MTC\Desktop\JS\node_modules\puppeteer\lib\cjs\puppeteer\common\Page.js:1155:16)

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?您是否尝试在操作中添加“等待”? Ie IE

await page.goto(urlTwo)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM