question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] browser has no newPage method

See original GitHub issue

Context:

  • Playwright Version: 0.10
  • Operating System: Linux

Code Snippet

This snippet:

import playwright from "playwright";

(async () => {
  const browser = await playwright.chromium.launch();
  const page = await browser.newPage("http://whatsmyuseragent.org/");
  await page.screenshot({ path: `example-chromium.png` });
  await browser.close();
})();

gives me this Typescript error:

Property 'newPage' does not exist on type 'CRBrowser'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
lcswillemscommented, Feb 9, 2020

In this case, you should update the examples on the home README

1reaction
lcswillemscommented, Feb 15, 2020

I don’t remember precisely but I know that waitForSelector was not working with Puppeteer on headless mode (it was waiting indefenitely). I tried with Playwright and it was working fine with webkit for example.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Puppeteer: browser.newPage is not a function - Stack Overflow
Someone on Guilded helped me resolve this with a pretty simple fix. Basically both the puppeteer.launch({}); and browser.newPage(); return a ...
Read more >
Puppeteer quick start - Chrome Developers
Install and run Puppeteer.
Read more >
Web Scraping with a Headless Browser: A Puppeteer Tutorial
First, we launch a new headless browser instance, then we open a new page (tab) and navigate to the URL provided in the...
Read more >
Browser.newPage() method - Puppeteer
Promise which resolves to a new Page object. The Page is created in a default browser context. Signature:​. class Browser ...
Read more >
473481 - page-break-before/page-break-after fails to force ...
Add OK or FAIL after other browsers where you have tested this issue: ... CSS Working Group, no current way to force a...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found