@zorilla/puppeteer-extra-plugin-click-and-wait
v1.0.1
Published
Convenience function to wait for navigation to complete after clicking on an element.
Maintainers
Readme
puppeteer-extra-plugin-click-and-wait
A plugin for
puppeteer-extra.
Install
npm install puppeteer-extra-plugin-click-and-waitAPI
Table of Contents
Plugin
Extends: PuppeteerExtraPlugin
Convenience function to wait for navigation to complete after clicking on an element.
Adds a new page.clickAndWaitForNavigation(selector, clickOptions, waitOptions) method.
See this issue for more context: https://github.com/GoogleChrome/puppeteer/issues/1421
Note: Be wary of ajax powered pages where the navigation event is not triggered.
Type: function (opts)
opts(optional, default{})
Example:
await page.clickAndWaitForNavigation('input#submitData')
// as opposed to:
await Promise.all([
page.waitForNavigation(waitOptions),
page.click('input#submitData', clickOptions),
])