From f9b017efaa92e3944395c05bd6a489abf00e44b7 Mon Sep 17 00:00:00 2001 From: Andrew Apicello Date: Fri, 27 Oct 2017 05:10:35 -0400 Subject: [PATCH] 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. --- examples/search.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/examples/search.js b/examples/search.js index 794f0530..535f3c68 100644 --- a/examples/search.js +++ b/examples/search.js @@ -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');