25 lines
1.0 KiB
JavaScript
25 lines
1.0 KiB
JavaScript
const { chromium } = require('playwright');
|
|
const fs = require('fs');
|
|
(async () => {
|
|
const browser = await chromium.launch({ headless: true });
|
|
const page = await browser.newPage();
|
|
|
|
await page.goto('https://weval-consulting.com/weval-technology-platform.html', { waitUntil: 'networkidle', timeout: 30000 });
|
|
await page.waitForTimeout(5000);
|
|
|
|
const info = await page.evaluate(() => {
|
|
const allScripts = [...document.querySelectorAll('script')].map(s => s.src || 'inline');
|
|
return {
|
|
title: document.title,
|
|
url: location.href,
|
|
bodyText: document.body ? document.body.textContent.substring(0, 500) : '',
|
|
bodyChildren: document.body ? document.body.children.length : 0,
|
|
scriptCount: allScripts.length,
|
|
scripts: allScripts.slice(0, 15),
|
|
htmlSize: document.documentElement.outerHTML.length
|
|
};
|
|
});
|
|
console.log(JSON.stringify(info, null, 2).substring(0, 1500));
|
|
await browser.close();
|
|
})();
|