chore(examples): update search example (#1181)
The search bar was not fully loaded and therefore "puppeteer" could not be entered into the submit field. This patch starts waiting for the input element to be rendered to ensure this element is loaded before attempting to populate it.
This commit is contained in:
parent
5ffbd0d221
commit
f9b017efaa
@ -23,6 +23,8 @@ const puppeteer = require('puppeteer');
|
||||
const browser = await puppeteer.launch();
|
||||
const page = await browser.newPage();
|
||||
await page.goto('https://google.com', {waitUntil: 'networkidle2'});
|
||||
|
||||
await page.waitFor('input[name=q]');
|
||||
// Type our query into the search bar
|
||||
await page.type('input[name=q]', 'puppeteer');
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user