I tried to get the Document of a Website with Puppetter but somehow page.evaluate doesnt work the way i thought.
let browser = await puppeteer.launch({headless:true});
let page = await browser.newPage();
await page.setViewport({
width: 1920,
height: 1080
})
await page.goto('https://www.tradingview.com/chart/');
const doc = await page.evaluate(() => {
return document;
});
console.log(doc)
When i print doc it prints undefined