It seems that while content
method of Page
is defined and documented, it is not exported.
const puppeteer = require("puppeteer")
const resolution = {
x : 1920,
y : 1080,
}
const args = [
"--no-first-run",
"--disable-sync",
"--disable-gpu",
"--disable-translate",
"--disable-background-networking",
"--single-process",
`--window-size=${ resolution.x },${ resolution.y }`,
'--no-sandbox',
'--disable-setuid-sandbox',
'--shm-size=1G'
]
const fn = async () => {
try {
const browser = await puppeteer.launch({
headless : true,
handleSIGINT : false,
args : args,
})
const page = await browser.newPage()
page.on("console", (...args) => {
for (let i = 0; i < args.length; ++i) { console.log(`${ i }: ${ args[ i ] }`) }
})
await page.setViewport({width: resolution.x, height: resolution.y})
await page.goto('https://ilearnsmarter.com/', {
waitUntil : "networkidle"
})
console.log(await page.content())
await page.close()
browser.close()
} catch (err) {
console.log(err)
}
}
fn()
@selfrefactor See #483
You can install the tip-of-tree in this way:
npm install https://github.com/GoogleChrome/puppeteer/
It works - thanks for the quick reply!
I met the seen problem! and it works!
Most helpful comment
I met the seen problem! and it works!