1

Fixed screenshot capture

This commit is contained in:
2025-04-07 10:49:06 +02:00
parent 9c79c48a0c
commit fd4f828460

View File

@@ -10,7 +10,7 @@ puppeteer.use(StealthPlugin());
* @param {string} screenshotPath - Path where the screenshot should be saved. * @param {string} screenshotPath - Path where the screenshot should be saved.
* @returns {Promise<object>} - Metadata including title, description, keywords, language, and HTTP status. * @returns {Promise<object>} - Metadata including title, description, keywords, language, and HTTP status.
*/ */
async function scrapePage(url, screenshotPath, { screenshot = true }) { async function scrapePage(url, screenshotPath) {
console.log(`🔍 Scraping: ${url}`); console.log(`🔍 Scraping: ${url}`);
const browser = await puppeteer.launch({ const browser = await puppeteer.launch({
@@ -90,7 +90,7 @@ async function scrapePage(url, screenshotPath, { screenshot = true }) {
}); });
if (screenshot && screenshotPath) { if (screenshotPath) {
await page.screenshot({ path: screenshotPath, fullPage: true }); await page.screenshot({ path: screenshotPath, fullPage: true });
console.log(`✔ Screenshot saved: ${screenshotPath}`); console.log(`✔ Screenshot saved: ${screenshotPath}`);
} }