const { chromium } = require('@playwright/test'); (async () => { const browser = await chromium.launch(); const page = await browser.newPage(); const r = await page.request.get('https://geograsim.at/teacher.html'); const html = await r.text(); // 1) Static tab-bar markup const tb = html.indexOf('id="tab-bar"'); console.log('--- #tab-bar markup ---'); console.log(tb >= 0 ? html.slice(tb - 40, tb + 700) : 'tab-bar id NOT found'); // 2) Extract _liveQualityBar function body and run it in isolation const start = html.indexOf('function _liveQualityBar'); // find matching braces let i = html.indexOf('{', start), depth = 0, end = -1; for (; i < html.length; i++) { if (html[i] === '{') depth++; else if (html[i] === '}') { depth--; if (depth === 0) { end = i + 1; break; } } } const fnSrc = html.slice(start, end); const fn = new Function(fnSrc + '\nreturn _liveQualityBar;')(); const sample = fn(8, 2); console.log('\n--- _liveQualityBar(8,2) OUTPUT ---'); console.log(sample); console.log('\ncontains "80":', String(sample).includes('80')); await browser.close(); })();