import { chromium } from 'playwright'; async function main() { const browser = await chromium.launch({ headless: true }); const page = await browser.newPage(); const url = 'https://masstimes.org/search?lat=32.7765&lng=-79.9311&type=parish'; console.log('Loading:', url); await page.goto(url, { waitUntil: 'networkidle', timeout: 60000 }); // Wait for Angular to render await page.waitForTimeout(5000); // Take screenshot await page.screenshot({ path: '/tmp/masstimes-debug.png', fullPage: true }); console.log('Screenshot saved to /tmp/masstimes-debug.png'); // Get page HTML const html = await page.content(); console.log('\n--- PAGE HTML (first 5000 chars) ---\n'); console.log(html.substring(0, 5000)); // Try to find any visible text that looks like church names const visibleText = await page.evaluate(() => { const walker = document.createTreeWalker(document.body, NodeFilter.SHOW_TEXT); const texts: string[] = []; let node; while ((node = walker.nextNode())) { const text = node.textContent?.trim(); if (text && text.length > 10 && text.length < 100) { texts.push(text); } } return texts.slice(0, 50); }); console.log('\n--- VISIBLE TEXT SNIPPETS ---\n'); visibleText.forEach((t, i) => console.log(`${i + 1}. ${t}`)); await browser.close(); } main().catch(console.error);