import { chromium } from './node_modules/playwright/index.mjs';
import { readFileSync } from 'fs';
import path from 'path';

const browser = await chromium.launch({
  executablePath: '/home/node/.cache/ms-playwright/chromium-1208/chrome-linux64/chrome',
  args: ['--no-sandbox', '--disable-dev-shm-usage', '--disable-gpu']
});
const page = await browser.newPage();
await page.setViewportSize({ width: 836, height: 600 });
const html = readFileSync(path.resolve('proxmox_lxc145.html'), 'utf8');
await page.setContent(html, { waitUntil: 'networkidle' });
await page.screenshot({ path: 'proxmox_lxc145.png', fullPage: true });
console.log('✅ Screenshot pris');
await browser.close();
