0

I'm trying to access an object that is loaded dynamically on the web page.

enter image description here

But the problem is that I can't access that data through the window object, even though it's loaded on the page.

enter image description here

Here's a simple script I'm using.

const browser = await puppeteer.launch();
const [page] = await browser.pages();

await page.goto(pageUrl, {waitUntil: 'networkidle2'});

let data = await page.evaluate(() => {
    let info = window._wq;
    return { info};
  });

for( i in data){
  console.log(i, data[i])
}

await browser.close();
ErrorByNight
  • 79
  • 2
  • 7
  • Does this answer your question? [How can I capture all network requests and full response data when loading a page in Chrome?](https://stackoverflow.com/questions/52969381/how-can-i-capture-all-network-requests-and-full-response-data-when-loading-a-pag) – Navanshu Rastogi Aug 25 '20 at 03:08
  • You shouldn't need to: Puppeteer is designed for you to run and use a page, not "inspect its internals". You interact with the page, _through using that page_ (clicking buttons, typing text in inputs, clicking links, etc), not by calling JS and accessing page internals like its `window`. What are you actually trying to do that makes you think you need that kind of access? – Mike 'Pomax' Kamermans Aug 25 '20 at 03:51

0 Answers0