import {chromium} from 'playwright'; const b = await chromium.launch({channel: 'chrome'}); const p = await b.newPage({viewport: {width: 390, height: 780}, isMobile: true, hasTouch: true}); await p.goto('http://localhost/s/stay', {waitUntil: 'domcontentloaded'}); await p.waitForTimeout(5000); console.log(await p.evaluate(() => { const out = []; document.querySelectorAll('#root *').forEach((el) => { const s = getComputedStyle(el); if (!/auto|scroll/.test(s.overflowX)) return; if (el.scrollWidth - el.clientWidth < 40) return; let sec = el.closest('section'); let name = sec?.id || ''; if (!name) { const h = sec?.querySelector('h2'); name = h ? h.textContent.trim().slice(0, 10) : '-'; } out.push({sec: name, scrollW: el.scrollWidth, clientW: el.clientWidth}); }); const itin = document.querySelector('#itinerary'); return JSON.stringify({rails: out, itinExists: !!itin, itinH2: itin?.querySelector('h2')?.textContent.trim(), sections: [...document.querySelectorAll('#root section')].map((s) => s.id || (s.querySelector('h2')?.textContent.trim().slice(0, 8) || '-'))}, null, 1); })); await b.close();