Files
html/api/transform-scan.js
2026-04-25 02:20:29 +02:00

35 lines
1.7 KiB
JavaScript

const { chromium } = require("playwright");
(async () => {
const b = await chromium.launch({ headless: true, args: ["--no-sandbox","--disable-gpu"] });
const ctx = await b.newContext({ viewport: {width:1920,height:1080} });
const pg = await ctx.newPage();
try {
await pg.goto("https://weval-consulting.com/aapreview.html", { waitUntil: "load", timeout: 35000 });
await pg.waitForTimeout(15000);
const r = await pg.evaluate(() => {
const cards = Array.from(document.querySelectorAll(".ag-card"));
// Check parent (CSS2DObject wrapper) and grand-parent (renderer)
const samples = ["WEVIA Master","Director","Master Router","Apple Edition","DeepSeek","WTP Hub","BioPython"].map(n => {
const c = document.querySelector('[data-agent="'+n+'"]');
if (!c) return {name:n, found:false};
const wrap = c.parentElement; // CSS2DObject wrapper
const renderer = wrap ? wrap.parentElement : null;
return {
name: n,
card_rect: (function(){const r=c.getBoundingClientRect(); return Math.round(r.width)+"x"+Math.round(r.height)+" @ "+Math.round(r.left)+","+Math.round(r.top);})(),
card_style: c.style.cssText.slice(0,150),
wrap_tag: wrap ? wrap.tagName : null,
wrap_style: wrap ? wrap.style.cssText.slice(0,200) : null,
wrap_rect: wrap ? (function(){const r=wrap.getBoundingClientRect(); return Math.round(r.width)+"x"+Math.round(r.height)+" @ "+Math.round(r.left)+","+Math.round(r.top);})() : null,
renderer_style: renderer ? renderer.style.cssText.slice(0,150) : null,
};
});
return samples;
});
console.log(JSON.stringify(r, null, 2));
} catch(e) { console.log("ERR:", e.message); }
await b.close();
})();