import { CDP, SAN } from '/tmp/cdp3.mjs'; const list=await (await fetch('http://127.0.0.1:9223/json/list')).json(); const t=list.find(x=>x.type==='page'&&/dianxiaomi/.test(x.url)); if(!t){console.log(' ❌');process.exit(0);} const c=await CDP.connect(t.webSocketDebuggerUrl); await c.send('Runtime.enable'); const r=await c.evalJS(`(async()=>{ const out=[]; const cands=[['/api/ozonProduct/getShop.json','GET'],['/api/shop/getShopList.json','GET'], ['/api/ozonProduct/shopList.json','GET'],['/api/ozonProduct/getAuthShopList.json','GET'], ['/api/shop/list.json','GET'],['/api/ozonProduct/getShopList.json','POST']]; for(const [u,m] of cands){ try{ const res=await Promise.race([ fetch(u, m==='POST'?{method:'POST',headers:{'Content-Type':'application/x-www-form-urlencoded','X-Requested-With':'XMLHttpRequest'},body:''} :{headers:{'X-Requested-With':'XMLHttpRequest'}}), new Promise((_,rj)=>setTimeout(()=>rj(new Error('to')),10000))]); const tx=await res.text(); if(res.status===200 && !tx.includes(' '+tx.slice(0,420)); }catch(e){} } return JSON.stringify(out);})()`, true); const arr=JSON.parse(r); if(!arr.length) console.log(' 店铺接口都没找到'); arr.forEach(x=>console.log(' ★ '+SAN(x).slice(0,420))); // 直接在页面上找店铺下拉里的映射 const dom=await c.evalJS(`(()=>{ const txt=document.body.innerText; const i=txt.indexOf('Yejet'); return JSON.stringify({has:txt.includes('Yejet'), around:i>=0?txt.slice(Math.max(0,i-60),i+60).replace(/\\n/g,' | '):''});})()`); console.log('\n 页面含 Yejet:', SAN(dom).slice(0,220)); c.close();