店小秘多平台铺货配方:7 平台建品脚本 + 静默拦截诊断法 + 项目状态
- TikTok/Shopee/速卖通/Walmart 各 46-47 条已在待发布 - Ozon 47 条已建、改价 40/47 - SHEIN 配方跑通第一条;Temu 差「预览图」一步 - 核心产出:MYJ.message.error 钩子诊断法(解开了三个平台的保存静默拦截) - 含下一轮提示词 NEXT-ROUND-PROMPT.md
This commit is contained in:
commit
f5720ad613
94 files changed
+21561
No files matched your search
@@ -0,0 +1,60 @@
|
||||
import { newTarget, CDP } from '/tmp/cdp3.mjs';
|
||||
const wait = ms => new Promise(z => setTimeout(z, ms));
|
||||
const SHOP='③shein-易捷天宇-美妆', CATKW='发夹';
|
||||
const tl = await (await fetch('http://127.0.0.1:9223/json/list')).json();
|
||||
for (const x of tl.filter(y=>y.type==='page'&&/shein/i.test(y.url))) await fetch(`http://127.0.0.1:9223/json/close/${x.id}`).catch(()=>{});
|
||||
await wait(900);
|
||||
const nt = await newTarget('about:blank');
|
||||
const c = await CDP.connect(nt.webSocketDebuggerUrl);
|
||||
await c.send('Page.enable'); await c.send('Runtime.enable');
|
||||
await c.send('Page.navigate',{url:'https://www.dianxiaomi.com/web/sheinProduct/add'});
|
||||
await wait(21000);
|
||||
// 店铺
|
||||
const sp=JSON.parse(String(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||'');});
|
||||
const s=(it||document).querySelector('.ant-select-selector'); s.scrollIntoView({block:'center'});
|
||||
const r=s.getBoundingClientRect(); return JSON.stringify([Math.round(r.x+r.width/2),Math.round(r.y+r.height/2)]);})()`)));
|
||||
for(const t of ['mousePressed','mouseReleased']) await c.send('Input.dispatchMouseEvent',{type:t,x:sp[0],y:sp[1],button:'left',clickCount:1});
|
||||
await wait(2400);
|
||||
await c.evalJS(`(()=>{const dd=[...document.querySelectorAll('.ant-select-dropdown')].filter(e=>e.offsetParent!==null).pop();
|
||||
const hit=[...dd.querySelectorAll('.ant-select-item-option')].find(o=>(o.innerText||'').trim()===${JSON.stringify(SHOP)});
|
||||
if(hit) for(const ev of ['mousedown','mouseup','click']) hit.dispatchEvent(new MouseEvent(ev,{bubbles:true,cancelable:true,view:window})); return 1;})()`);
|
||||
await wait(8000);
|
||||
// 类目
|
||||
const cp=JSON.parse(String(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||'');});
|
||||
const s=it.querySelector('.ant-select-selector'); s.scrollIntoView({block:'center'});
|
||||
const r=s.getBoundingClientRect(); return JSON.stringify([Math.round(r.x+r.width/2),Math.round(r.y+r.height/2)]);})()`)));
|
||||
for(const t of ['mousePressed','mouseReleased']) await c.send('Input.dispatchMouseEvent',{type:t,x:cp[0],y:cp[1],button:'left',clickCount:1});
|
||||
await wait(3500);
|
||||
console.log('类目:', String(await c.evalJS(`(()=>{const dd=[...document.querySelectorAll('.ant-select-dropdown')].filter(e=>e.offsetParent!==null).pop();
|
||||
if(!dd)return'no-dd'; const its=[...dd.querySelectorAll('.ant-select-item-option')];
|
||||
const hit=its.find(o=>new RegExp('^\\\\s*'+${JSON.stringify(CATKW)}).test((o.innerText||'').trim()));
|
||||
if(!hit)return'no-hit'; for(const ev of ['mousedown','mouseup','click']) hit.dispatchEvent(new MouseEvent(ev,{bubbles:true,cancelable:true,view:window}));
|
||||
return (hit.innerText||'').trim();})()`)));
|
||||
await wait(12000);
|
||||
// 标题
|
||||
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||'');});
|
||||
const el=it.querySelector('input:not([type=hidden])'); el.focus();
|
||||
Object.getOwnPropertyDescriptor(window.HTMLInputElement.prototype,'value').set.call(el,'Test Hair Clip Set for Women Girls Daily Use Fashion Accessory');
|
||||
el.dispatchEvent(new Event('input',{bubbles:true})); el.dispatchEvent(new Event('change',{bubbles:true}));
|
||||
const p=document.querySelector('#app').__vue_app__.config.globalProperties.$pinia;
|
||||
p._s.get('sheinAddProductStore').$state.formState.productName='Test Hair Clip Set for Women Girls Daily Use Fashion Accessory';
|
||||
return 1;})()`);
|
||||
await wait(1500);
|
||||
// 选主规格颜色(取第一个可选值)—— 先看控件结构
|
||||
const mg = 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 sels=[...it.querySelectorAll('.ant-select')].map(s=>({txt:(s.innerText||'').replace(/\\s+/g,' ').slice(0,40), cls:String(s.className).slice(0,50)}));
|
||||
const cbs=[...it.querySelectorAll('.ant-checkbox-wrapper,.ant-tag,[class*=tag]')].slice(0,6).map(e=>(e.innerText||'').trim().slice(0,16));
|
||||
return JSON.stringify({sels, cbs, html:it.innerHTML.slice(0,400)});})()`);
|
||||
console.log('主规格控件:', String(mg).slice(0,800));
|
||||
// 图片字段测试:数组 vs 字符串
|
||||
const imgTest = await c.evalJS(`(()=>{const p=document.querySelector('#app').__vue_app__.config.globalProperties.$pinia;
|
||||
const im=p._s.get('sheinImgStore').$state.formState;
|
||||
const before=JSON.stringify(im).slice(0,120);
|
||||
return JSON.stringify({before});})()`);
|
||||
console.log('图片字段现状:', String(imgTest).slice(0,300));
|
||||
process.exit(0);
|
||||
Reference in new issue
Block a user