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

133
Vistas
how can I get the url of a page that opened in a different tab with puppeteer, or extract the URL from the " click here " link?
// this clicks on the link after page is loaded,
// there is whole process going before coming to this point.
await page.click('#ctl00_chpMain_ucContractDetails');

const url = await newPage.evaluate(() => document.location.href);
console.log(url); // this code didnt work for me.
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

You need to catch the tab creation event:

const [url] = await Promise.all([
  new Promise((resolve, reject) => {
    browser.once('targetcreated', (target) => { resolve(target.url()); });
  }),
  page.click('#ctl00_chpMain_ucContractDetails'),
]);

console.log(url);
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