"Enter"a basıp içeriğe geçin

puppeteer Ekran Görüntüsü alma

Eğer bir sayfanın ekran görüntüsü almak isterseniz aşağıdaki kodu kullanabilirsiniz. hata aldığınızda bu fonksiyonu kullanabilirsiniz.

// playwright-extra is a drop-in replacement for playwright,
// it augments the installed playwright with plugin functionality
const { chromium } = require(‘playwright-extra’)

// Load the stealth plugin and use defaults (all tricks to hide playwright usage)
// Note: playwright-extra is compatible with most puppeteer-extra plugins
const stealth = require(‘puppeteer-extra-plugin-stealth’)()

// Add the plugin to playwright (any number of plugins can be added)
chromium.use(stealth)

// That’s it, the rest is playwright usage as normal 😊
chromium.launch({ headless: false }).then(async browser => {
constpage = awaitbrowser.newPage()

console.log(‘Testing the stealth plugin..’)
awaitpage.goto(‘https://www.tasarimrehberi.com’, { waitUntil:’networkidle’ })
awaitpage.screenshot({ path:’stealth.png’, fullPage:true })

console.log(‘All done, check the screenshot. ✨’)
//wait browser.close()
})