Temu 全托管:解「预览图」静默拦截(逐行点单元格→引用产品轮播图),首条已进待发布;补 tmpv.mjs 配方与 /draft=采集箱 /offline=待发布 路由事实
This commit is contained in:
1 parent
719ad2b609
commit
cdde45ed9a
4 files changed
+135
-3
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import { newTarget, attach, SAN } from '/tmp/cdp3.mjs';
|
||||
const wait=ms=>new Promise(z=>setTimeout(z,ms));
|
||||
const path='/web/temu/choiceTemuList/offline';
|
||||
await newTarget('https://www.dianxiaomi.com'+path);
|
||||
await wait(11000);
|
||||
const c = await attach('/choiceTemuList/offline');
|
||||
if(!c){console.log('attach fail');process.exit(1);}
|
||||
const set = await c.evalJS(`(()=>{
|
||||
const el=[...document.querySelectorAll('input.ant-input')].filter(e=>e.offsetParent!==null).find(e=>!e.placeholder||e.placeholder===' ');
|
||||
if(!el) return 'no-input';
|
||||
const setter=Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,'value').set;
|
||||
setter.call(el,'Hair Clips Set for Women'); el.dispatchEvent(new Event('input',{bubbles:true})); return 'set';})()`);
|
||||
console.log('输入:', String(set));
|
||||
await wait(700);
|
||||
await c.evalJS(`(()=>{const b=[...document.querySelectorAll('button')].find(x=>/^\\s*搜索\\s*$/.test((x.innerText||'').trim()));
|
||||
if(b) for(const ev of ['mousedown','mouseup','click']) b.dispatchEvent(new MouseEvent(ev,{bubbles:true,cancelable:true,view:window})); return 1;})()`);
|
||||
await wait(9000);
|
||||
const o = await c.evalJS(`(()=>{
|
||||
const rows=[...document.querySelectorAll('.vxe-body--row')].map(r=>(r.innerText||'').replace(/\\s+/g,' ').trim());
|
||||
const body=(document.body.innerText||'').replace(/\\s+/g,' '); const m=body.match(/共\\s*\\d+\\s*条/);
|
||||
return JSON.stringify({total:m?m[0]:'', n:rows.length, first:rows.slice(0,3).map(t=>t.slice(0,150))});})()`);
|
||||
console.log('待发布搜索:', SAN(String(o)).slice(0,900));
|
||||
try{ await c.shot('/tmp/temu_offline.jpg'); console.log('shot ok'); }catch(e){ console.log('shot fail'); }
|
||||
process.exit(0);
|
||||
Reference in new issue
Block a user