#!/usr/bin/env node const puppeteer = require('puppeteer'); const QUICK_URL = 'https://emexdwc.ae/QuickDetails.aspx?c=SUBARU201802&gid=11884&vid=0&ssd=$*KwGdqbit1suR0ubYx-jFj8XR8fbomJ-emYinlNza6f7m4Nf0houS7-TvmejqkOewy9Ponp-Rlp6c1YC4n43Hi5KN5O-asbzd4-ian-ien5LPyNGNgovNjZSYmsXOyI3Xi5KN6IvWAAAAAHBDYDE=$'; (async () => { const browser = await puppeteer.launch({ headless: 'new', args: ['--no-sandbox'] }); const page = await browser.newPage(); await page.setViewport({ width: 1400, height: 900 }); await page.goto(QUICK_URL, { waitUntil: 'networkidle2', timeout: 30000 }); await new Promise(r => setTimeout(r, 2000)); const unitUrl = await page.evaluate(() => { const link = document.querySelector('a[href*="Unit.aspx"]'); return link ? link.href : null; }); await page.goto(unitUrl, { waitUntil: 'networkidle2', timeout: 30000 }); await new Promise(r => setTimeout(r, 3000)); const info = await page.evaluate(() => { const img = document.querySelector('img.dragger[src*="laximo"]'); if (!img) return { error: 'no dragger img' }; return { naturalWidth: img.naturalWidth, naturalHeight: img.naturalHeight, offsetWidth: img.offsetWidth, offsetHeight: img.offsetHeight, clientWidth: img.clientWidth, clientHeight: img.clientHeight, // Also check the image container parentTag: img.parentElement?.tagName, parentClass: img.parentElement?.className, parentWidth: img.parentElement?.offsetWidth, parentHeight: img.parentElement?.offsetHeight, // Scale factor scaleX: img.naturalWidth / img.offsetWidth, scaleY: img.naturalHeight / img.offsetHeight, }; }); console.log(JSON.stringify(info, null, 2)); await browser.close(); })();