const { chromium } = require('playwright');
const path = require('path');

async function main() {
    const browser = await chromium.launch({
        headless: true,
        args: ['--no-sandbox', '--disable-setuid-sandbox']
    });

    const context = await browser.newContext({
        userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
        viewport: { width: 1440, height: 900 }
    });

    const page = await context.newPage();

    console.log('Loading LandProz agent page...');
    await page.goto('https://landproz.com/agent/?id=11', {
        waitUntil: 'domcontentloaded',
        timeout: 30000
    });
    await page.waitForTimeout(2000);

    await page.screenshot({
        path: path.join(__dirname, 'landproz-agent-screenshot.png'),
        fullPage: true
    });
    console.log('Screenshot saved: landproz-agent-screenshot.png');

    await browser.close();
}

main().catch(console.error);
