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: 1400 }); const errs = []; page.on('console', m => { if (m.type() === 'error') errs.push(m.text().slice(0, 200)); }); page.on('pageerror', e => errs.push('PAGEERROR: ' + e.message.slice(0, 200))); await page.goto('https://bazarowy-swiat.pl/?add-to-cart=7892&variation_id=7892&attribute_pa_strona=lewy&attribute_pa_kod-odcienia=39&quantity=1', { waitUntil: 'networkidle2', timeout: 90000 }); await page.goto('https://bazarowy-swiat.pl/zamowienie/', { waitUntil: 'networkidle2', timeout: 90000 }); await new Promise(r => setTimeout(r, 8000)); console.log('URL:', page.url()); const state = await page.evaluate(() => ({ title: document.title, checkoutBlock: !!document.querySelector('.wc-block-checkout, .wp-block-woocommerce-checkout'), fields: document.querySelectorAll('input').length, text: document.body.innerText.slice(0, 1200), })); console.log('block:', state.checkoutBlock, 'fields:', state.fields, 'title:', state.title); console.log(state.text); await page.screenshot({ path: 'checkout_state.png' }); console.log('ERRS:', JSON.stringify(errs.slice(0, 15), null, 1)); await browser.close(); })().catch(e => console.error('ERR', e.message));