puppeteer-extra-plugin-click-and-wait
v2.3.3
Published
Convenience function to wait for navigation to complete after clicking on an element.
Downloads
2,066
Maintainers
Readme
puppeteer-extra-plugin-click-and-wait
A plugin for puppeteer-extra.
Install
yarn add puppeteer-extra-plugin-click-and-wait
API
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),
])