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)); const clicked = await page.evaluate(() => { const b = [...document.querySelectorAll('button, a')].find(x => /Wdr[oó]ż teraz/i.test(x.innerText) && x.offsetParent); if (b) { b.click(); return 'clicked Wdroz teraz'; } return 'not found'; }); console.log(clicked); await new Promise(r => setTimeout(r, 25000)); await page.screenshot({ path: 'plesk_deploy3.png' }); await browser.close(); })().catch(e => { console.error('ERR', e.message); });