import pkg from 'file:///D:/Projects/MarketingAgent/qa-tester/node_modules/playwright/index.js'; const { chromium } = pkg; const b = await chromium.connectOverCDP('http://127.0.0.1:9222'); const page = await b.contexts()[0].newPage(); await page.setViewportSize({ width: 1340, height: 1000 }); await page.goto('https://adrevsplit.com/login.php', { waitUntil:'domcontentloaded', timeout:45000 }); await page.waitForTimeout(3000); console.log(JSON.stringify(await page.evaluate(() => { const col = document.querySelector('.col-lg-10, .custom-col-10'); const out = { colTop: col ? Math.round(col.getBoundingClientRect().top) : null, children: [] }; if (col) for (const c of col.children) { if (c.getBoundingClientRect().height === 0) continue; const r = c.getBoundingClientRect(); const cs = getComputedStyle(c); out.children.push({ tag: c.tagName, cls: (c.className||'').toString().slice(0,30), top: Math.round(r.top), h: Math.round(r.height), mt: cs.marginTop, mb: cs.marginBottom, text: (c.innerText||'').replace(/\s+/g,' ').trim().slice(0,40) }); } const ul = document.querySelector('.flexy-menu'); out.menuTop = ul ? Math.round(ul.getBoundingClientRect().top) : null; const sec = document.querySelector('section.container'); out.sectionTop = sec ? Math.round(sec.getBoundingClientRect().top) : null; out.sectionPadTop = sec ? getComputedStyle(sec).paddingTop : null; return out; }, null), null, 1)); await b.close();