妙手:登录成功(真实表单选择器+base64验证码流程)+ 采集箱可达(common_collect_box),技能档选择器已失效需更正
This commit is contained in:
1 parent
96cee1c206
commit
ce9db92f31
6 files changed
+135
-24
No files matched your search
@@ -0,0 +1,22 @@
|
||||
import { listPages, wait } from '/home/admin9webs/shein建品/sh_lib.mjs';
|
||||
import { CDP, SAN as S } from '/tmp/cdp3.mjs';
|
||||
const t = (await listPages()).find(x=>/91miaoshou/i.test(x.url));
|
||||
const c = await CDP.connect(t.webSocketDebuggerUrl);
|
||||
await c.send('Page.enable'); await c.send('Runtime.enable'); await wait(1500);
|
||||
// hover 产品
|
||||
const p = JSON.parse(String(await c.evalJS(`(()=>{const e=document.querySelector('.J_navBarGoods')||document.querySelector('.nav-item-goods');
|
||||
if(!e) return '[]'; const r=e.getBoundingClientRect(); return JSON.stringify([Math.round(r.x+r.width/2),Math.round(r.y+r.height/2)]);})()`)));
|
||||
console.log('产品坐标:', JSON.stringify(p));
|
||||
await c.send('Input.dispatchMouseEvent',{type:'mouseMoved',x:p[0],y:p[1],buttons:0}); await wait(1500);
|
||||
for(const tp of ['mousePressed','mouseReleased']) await c.send('Input.dispatchMouseEvent',{type:tp,x:p[0],y:p[1],button:'left',clickCount:1,buttons:1});
|
||||
await wait(2500);
|
||||
const o = await c.evalJS(`(()=>{
|
||||
const items=[...document.querySelectorAll('.function-item,.menu-item,.menu-title,a')].filter(e=>e.offsetParent!==null)
|
||||
.map(e=>({t:(e.innerText||'').replace(/\\s+/g,' ').trim().slice(0,16), h:e.getAttribute&&e.getAttribute('href')||'', cls:String(e.className).slice(0,30)}))
|
||||
.filter(x=>x.t&&x.t.length>1);
|
||||
const uniq=[]; const seen=new Set();
|
||||
for(const i of items){ if(!seen.has(i.t)){seen.add(i.t); uniq.push(i);} }
|
||||
return JSON.stringify(uniq.slice(0,25));})()`);
|
||||
console.log('产品子菜单:', S(String(o)).slice(0,1200));
|
||||
try{ await c.shot('/tmp/ms_menu.jpg'); console.log('shot ok'); }catch(e){}
|
||||
process.exit(0);
|
||||
Reference in new issue
Block a user