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

308
Vistas
titiritero UnhandledPromiseRejectionWarning: TypeError: No se puede leer la propiedad 'getProperty' de undefined

Recibí el siguiente error en un programa de JavaScript con titiritero: UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'getProperty' of undefined

Lo he comprobado varias veces, pero el elemento existe y se puede encontrar a través de XPath. Aquí está mi código

 const puppeteer = require('puppeteer'); async function scraping(url, username, password) { const browser = await puppeteer.launch(); const page = await browser.newPage(); await page.goto(url, { waitUntil: 'networkidle0' }); const [loginTitle] = await page.$x('/html/body/div[1]/div[2]/div/div/div[1]/h3'); const loginTitleTxt = await loginTitle.getProperty('textContent') const loginTitleRawTxt = await loginTitleTxt.jsonValue(); const [usernameInputField] = await page.$x('//*[@id="form-username"]/input'); usernameInputField.type(username); const [passwordInputField] = await page.$x('//*[@id="form-password"]/input'); passwordInputField.type(password); await page.evaluate(() => { document.evaluate('/html/body/div[1]/div[2]/div/div/div[2]/form/div[3]/div[1]/button', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null).singleNodeValue.click(); }); // Here is the error const [planTitle] = await page.$x('/html/body/center[1]/p[1]/table/tbody/tr[2]/td'); const planTitleTxt = await planTitle.getProperty('textContent') const planTitleRawTxt = await planTitleTxt.jsonValue(); console.log(planTitleRawTxt); browser.close(); } scraping('https://hereisttheurl.net/abc.html', 'aa.bb', '123');

about 4 years ago · Juan Pablo Isaza
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