const puppeteer = require('C:/xampp/htdocs/vilmax/vilmax-cockpit/node_modules/puppeteer'); (async () => { const browser = await puppeteer.launch({ headless: 'new', args: ['--ignore-certificate-errors'] }); const page = await browser.newPage(); await page.setViewport({ width: 1440, height: 1300 }); await page.setCookie({ name: 'PLESKSESSID', value: 'ac68b2d34301cce8d78624231877bc21', domain: 'bazarowy-swiat.pl', path: '/' }); await page.goto('https://bazarowy-swiat.pl:8443/modules/git/index.php/domain/repositories?dom_id=529&site_id=581', { waitUntil: 'networkidle2', timeout: 90000 }); await new Promise(r => setTimeout(r, 5000)); await page.evaluate(() => { const b = [...document.querySelectorAll('button')].find(x => /Akceptuj niezb[eę]dne/i.test(x.innerText)); if (b) b.click(); }); // otworz ustawienia repo (ikona gear) await new Promise(r => setTimeout(r, 1500)); await page.evaluate(() => { const gear = [...document.querySelectorAll('button')].find(e => /settings|gear/i.test(e.className + ' ' + (e.getAttribute('aria-label') || ''))); gear && gear.click(); }); await new Promise(r => setTimeout(r, 3000)); // stan checkboxa + pola const st = await page.evaluate(() => { const modal = document.querySelector('[role="dialog"], .modal, [class*="modal"], [class*="dialog"]'); const cbs = [...document.querySelectorAll('input[type="checkbox"]')].map(c => ({ checked: c.checked, label: (c.closest('label')?.innerText || c.parentElement?.innerText || '').slice(0, 80) })); const tas = [...document.querySelectorAll('textarea')].map(t => ({ val: t.value.slice(0, 200), visible: !!t.offsetParent })); return { cbs, tas, modalFound: !!modal }; }); console.log('STATE:', JSON.stringify(st, null, 1)); await page.screenshot({ path: 'plesk_settings2.png' }); await browser.close(); })().catch(e => { console.error('ERR', e.message); });