const {chromium} = require('/home/ubuntu/.openclaw/workspace/node_modules/playwright'); (async()=>{ const browser = await chromium.launch({headless:true, args:['--no-sandbox']}); const page = await browser.newPage(); const captured = []; page.on('response', async resp => { const url = resp.url(); const skip = ['vtexassets','analytics','gtm','facebook','.js','.css','.png','.jpg','.svg','.woff','segment','amplitude','hotjar']; if (skip.some(s=>url.includes(s))) return; const ct = resp.headers()['content-type']||''; if (!ct.includes('json') && !url.includes('graphql')) return; try { const text = await resp.text(); if (!text || text.length < 20) return; const lower = text.toLowerCase(); const kws = ['descuento','discount','promo','banco','tarjeta','reintegro','cuota','vigencia','legal','bancari']; const hits = kws.filter(w=>lower.includes(w)).length; captured.push({url:url.slice(0,150), status:resp.status(), len:text.length, hits, preview:text.slice(0,300)}); } catch {} }); page.on('request', req => { const url = req.url(); if (url.includes('graphql') || url.includes('/api/') || url.includes('medios') || url.includes('promo') || url.includes('banco')) { console.log(`REQ [${req.method()}]: ${url.slice(0,150)}`); } }); console.log('Loading DIA medios-de-pago...'); await page.goto('https://diaonline.supermercadosdia.com.ar/medios-de-pago', {waitUntil:'networkidle', timeout:35000}).catch(e=>console.log('nav err:',e.message.slice(0,50))); await page.waitForTimeout(4000); console.log('\n=== DIA API responses with discount keywords ==='); const hits2 = captured.filter(c=>c.hits>=2).sort((a,b)=>b.hits-a.hits); hits2.forEach(c=>console.log(`hits=${c.hits} len=${c.len} ${c.url}\n preview: ${c.preview.slice(0,200)}\n`)); if (!hits2.length) { console.log('No discount responses found. All captured:'); captured.slice(0,20).forEach(c=>console.log(`hits=${c.hits} ${c.url}`)); } await browser.close(); })().catch(e=>console.error(e));