← Back
import { chromium } from 'playwright';
const b = await chromium.launch({ executablePath:'/usr/bin/chromium-browser', args:['--no-sandbox'] });
const ctx = await b.newContext({ viewport:{ width:390, height:844 }, deviceScaleFactor:2, serviceWorkers:'block' });
const p = await ctx.newPage();
const errs=[]; p.on('console',m=>{ if(m.type()==='error') errs.push(m.text()); });
p.on('pageerror',e=>errs.push('PAGEERR: '+e.message));
await p.goto('https://poly-dev.szhub.space/preview', { waitUntil:'networkidle', timeout:30000 });
await p.waitForTimeout(2500);
const txt = await p.evaluate(()=>document.body.innerText.slice(0,200));
const hasPk = await p.evaluate(()=>!!document.querySelector('.pk-root'));
await p.screenshot({ path:'/home/app/polymarket-screener/redesign/mockup/_live.png' });
await b.close();
console.log('hasPkRoot:', hasPk);
console.log('bodyText:', JSON.stringify(txt));
console.log('errors:', errs.slice(0,5).join(' | ') || 'none');