diff --git a/README.md b/README.md index 77b4dfa8..2767e223 100644 --- a/README.md +++ b/README.md @@ -163,7 +163,7 @@ import puppeteer from 'puppeteer'; const textSelector = await page.waitForSelector( 'text/Customize and automate' ); - const fullTitle = await textSelector.evaluate(el => el.textContent); + const fullTitle = await textSelector?.evaluate(el => el.textContent); // Print the full title console.log('The title of this blog post is "%s".', fullTitle); diff --git a/docs/index.md b/docs/index.md index 77b4dfa8..2767e223 100644 --- a/docs/index.md +++ b/docs/index.md @@ -163,7 +163,7 @@ import puppeteer from 'puppeteer'; const textSelector = await page.waitForSelector( 'text/Customize and automate' ); - const fullTitle = await textSelector.evaluate(el => el.textContent); + const fullTitle = await textSelector?.evaluate(el => el.textContent); // Print the full title console.log('The title of this blog post is "%s".', fullTitle); diff --git a/website/versioned_docs/version-20.1.1/index.md b/website/versioned_docs/version-20.1.1/index.md index 77b4dfa8..2767e223 100644 --- a/website/versioned_docs/version-20.1.1/index.md +++ b/website/versioned_docs/version-20.1.1/index.md @@ -163,7 +163,7 @@ import puppeteer from 'puppeteer'; const textSelector = await page.waitForSelector( 'text/Customize and automate' ); - const fullTitle = await textSelector.evaluate(el => el.textContent); + const fullTitle = await textSelector?.evaluate(el => el.textContent); // Print the full title console.log('The title of this blog post is "%s".', fullTitle);