import { attach } from '/tmp/cdp3.mjs'; const c = await attach('/web/temu/add') || await attach('dianxiaomi.com'); const o = await c.evalJS(`(()=>{ // 找含“颜色”且含“添加/请选择”的容器 const cands=[...document.querySelectorAll('div')].filter(e=>e.offsetParent!==null&&/颜色/.test(e.innerText||'')&&e.querySelectorAll('input').length>=1&&e.querySelectorAll('*').length<400); const box=cands[cands.length-1]; if(!box)return'nf'; const ins=[...box.querySelectorAll('input')].filter(i=>i.offsetParent!==null).map(i=>({type:i.type,ph:i.placeholder||'',cls:String(i.className||'').slice(0,50),dis:i.disabled})); const btns=[...box.querySelectorAll('button')].filter(e=>e.offsetParent!==null).map(b=>({t:(b.innerText||'').trim().slice(0,12),dis:b.disabled,cls:String(b.className||'').slice(0,40)})); return JSON.stringify({n:cands.length, txt:(box.innerText||'').replace(/\\s+/g,' ').slice(0,320), ins, btns},null,1);})()`); console.log(String(o).slice(0,1500)); process.exit(0);