Update index.js
Browse files2 unmodified lines34567891011121314151617181920212223242526272829303132333435363738392 unmodified lines(async () => {const browser = await chromium.launch({headless: true,args: ['--no-sandbox', '--disable-setuid-sandbox']});const page = await browser.newPage();try {await page.goto('https://en.ephoto360.com/create-3d-colorful-paint-text-effect-online-801.html', {waitUntil: 'domcontentloaded',timeout: 60000});await page.waitForSelector('input[name="text[]"]', { timeout: 30000 });await page.fill('input[name="text[]"]', 'TEST TEXT');await page.click('input[type="submit"][value="GO"]');await page.waitForTimeout(30000); // longer wait for generationconst imageUrl = await page.evaluate(() => {const imgs = [...document.querySelectorAll('img[src*="uploads"]')];return imgs.find(img =>img.src.includes('worigin') || img.src.includes('result'))?.src || null;});console.log('Generated image:', imageUrl || 'not found');if (!imageUrl) await page.screenshot({ path: 'debug.png', fullPage: true });} catch (err) {console.error('Error:', err.message);await page.screenshot({ path: 'error.png', fullPage: true });}await browser.close();2 unmodified lines3456789101112131415161718192021222324252627282930313233343536373839404142434445464748492 unmodified lines(async () => {const browser = await chromium.launch({headless: true,args: ['--no-sandbox', '--disable-setuid-sandbox', '--disable-dev-shm-usage']});const page = await browser.newPage();try {await page.setExtraHTTPHeaders({'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/134.0.0.0 Safari/537.36'});await page.goto('https://en.ephoto360.com/create-3d-colorful-paint-text-effect-online-801.html', {waitUntil: 'domcontentloaded',timeout: 90000});await page.waitForSelector('input[name="text[]"]', { timeout: 40000 });await page.fill('input[name="text[]"]', 'TEST TEXT');await page.click('input[value="GO"]');await page.waitForTimeout(45000);const imageUrl = await page.evaluate(() => {const imgs = document.querySelectorAll('img[src*="uploads"]');for (const img of imgs) {if (img.src.includes('worigin') || img.src.includes('result') || img.src.includes('w450')) {return img.src;}}return null;});console.log('Generated image:', imageUrl || 'not found');if (!imageUrl) {await page.screenshot({ path: 'debug.png', fullPage: true });console.log('Screenshot saved: debug.png');}} catch (err) {console.error('Error:', err.message);try { await page.screenshot({ path: 'error.png', fullPage: true }); } catch {}}await browser.close();
index.js+21-11