Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

447
Vistas
PlayWright - TypeError: browser.newPage is not a function

When ever I am trying to run the code I am getting error "TypeError: browser.newPage is not a function". Here is my code

const {chromium} = require('playwright');
(async() => {
const browser = chromium.launch({
    headless:false
});
const page = await browser.newPage();
await page.goto('https://www.google.com');
await browser.close();
})();

If I change the code to the following then I am able to run the code but url is not getting open whatever I am providing, Just browser is getting open and close.

const playwright = require('playwright');
(async () => {
  for (const browserType of ['webkit']) {
    const browser = await playwright[browserType].launch({
        headless:false
    });
    const context = await browser.newContext();
    const page = await context.newPage('https://www.google.com');
    await browser.close();
  }
})();

I am using Playwright version 1.20.0 node.js version is v16.14.0

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Try this

const context = await browser.newContext();
const page = await context.newPage();
await page.goto('https://www.google.com');

You might want to check out the documentation: https://playwright.dev/docs/1.19/intro#first-test

about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda