Puppeteer page.evaluate querySelectorAll return empty objects

前端 未结 3 1897
清酒与你
清酒与你 2020-12-10 11:38

I am trying out Puppeteer. This is a sample code that you can run on: https://try-puppeteer.appspot.com/

The problem is this code is returning an array of empty obje

3条回答
  •  有刺的猬
    2020-12-10 12:00

    I faced the similar problem and i solved it like this;

     await page.evaluate(() => 
           Array.from(document.querySelectorAll('.title'), 
           e => e.href));
    

提交回复
热议问题