← 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:1600 }, deviceScaleFactor:2, serviceWorkers:'block' });
const p = await ctx.newPage();
await p.goto('https://poly-dev.szhub.space/', { waitUntil:'domcontentloaded', timeout:35000 });
await p.waitForTimeout(6000);
const hasPk = await p.evaluate(()=>!!document.querySelector('.pk-leaders'));
const cards = await p.evaluate(()=>document.querySelectorAll('.pk-card').length);
const txt = await p.evaluate(()=>document.body.innerText.replace(/\n+/g,' ').slice(0,220));
await p.screenshot({ path:'_root.png' });
await b.close();
console.log('pk-leaders:', hasPk, '| pk-card count:', cards);
console.log('text:', JSON.stringify(txt));