import { attach } from '/tmp/cdp3.mjs'; const c = await attach('/web/sheinProduct/add') || await attach('dianxiaomi.com'); const o = await c.evalJS(`(()=>{ const it=[...document.querySelectorAll('.ant-form-item')].filter(e=>e.offsetParent!==null) .find(x=>{const l=x.querySelector('label'); return l&&/主规格/.test(l.innerText||'');}); if(!it)return'nf'; const box=it.querySelector('.sku-info-box')||it; // 列出所有叶子的 tag/class/文本 const leaves=[...box.querySelectorAll('*')].filter(e=>e.offsetParent!==null&&!e.children.length&&(e.innerText||'').trim()) .slice(0,14).map(e=>({tag:e.tagName, cls:String(e.className||'').slice(0,55), t:(e.innerText||'').trim().slice(0,18)})); const clickable=[...box.querySelectorAll('button,.ant-btn,.ant-tag,.ant-checkbox-wrapper,[class*=tag],[class*=item],[class*=option]')] .filter(e=>e.offsetParent!==null).slice(0,12).map(e=>({tag:e.tagName, cls:String(e.className||'').slice(0,50), t:(e.innerText||'').trim().slice(0,16)})); return JSON.stringify({leafCount:box.querySelectorAll('*').length, leaves, clickable},null,1);})()`); console.log(String(o).slice(0,2000)); process.exit(0);