Elffuss BraidHub

utopia-ia/elffuss-code public

main · 622 BRawPermalink
1import { chromium } from 'playwright';
2const OUT = (process.env.SCRATCH || '/tmp/elffuss-test');
3const b = await chromium.launch();
4const p = await b.newContext({ viewport: { width: 1280, height: 900 }, locale: 'es-ES' }).then(c => c.newPage());
5await p.goto('https://utopiaia.com/#elffuss', { waitUntil: 'networkidle' }).catch(()=>{});
6await p.waitForTimeout(3500);
7// scroll a la sección elffuss y captura
8await p.evaluate(() => document.querySelector('#elffuss')?.scrollIntoView());
9await p.waitForTimeout(1500);
10await p.screenshot({ path: OUT + '/utopiaia_elffuss_section.png' });
11await b.close();
12console.log('OK');