Puppeteer wait until page is completely loaded

后端 未结 7 1242
梦如初夏
梦如初夏 2020-12-01 06:40

I am working on creating PDF from web page.

The application on which I am working is single page application.

I tried many options and suggestion on https://

7条回答
  •  爱一瞬间的悲伤
    2020-12-01 06:50

    Wrap the page.click and page.waitForNavigation in a Promise.all

      await Promise.all([
        page.click('#submit_button'),
        page.waitForNavigation({ waitUntil: 'networkidle0' })
      ]);
    

提交回复
热议问题