import { chromium } from 'playwright'; import { bypassAgeGatePlaywright } from './src/utils/age-gate-playwright'; async function findDutchieMenu() { const browser = await chromium.launch({ headless: true }); const context = await browser.newContext({ userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36', viewport: { width: 1280, height: 720 } }); const page = await context.newPage(); try { console.log('Loading Curaleaf page and bypassing age gate...\n'); await page.goto('https://curaleaf.com/stores/curaleaf-dispensary-48th-street'); await page.waitForTimeout(2000); await bypassAgeGatePlaywright(page, 'Arizona'); await page.waitForTimeout(5000); console.log('Looking for Dutchie menu...\n'); // Check for iframes const frames = page.frames(); console.log(`Total frames on page: ${frames.length}`); for (let i = 0; i < frames.length; i++) { const frame = frames[i]; const url = frame.url(); console.log(`Frame ${i}: ${url}`); if (url.includes('dutchie')) { console.log(` āœ… This is the Dutchie menu!`); // Try to find the actual menu URL const menuUrl = url; console.log(`\nšŸ“ Dutchie Menu URL: ${menuUrl}\n`); // We should scrape this URL directly instead of the Curaleaf page console.log('šŸ’” Strategy: Scrape the Dutchie iframe URL directly'); console.log(` Example: ${menuUrl.split('?')[0]}/shop/flower\n`); } } // Also check for links to Dutchie const dutchieLinks = await page.locator('a[href*="dutchie"]').all(); console.log(`\nDutchie links found: ${dutchieLinks.length}`); for (const link of dutchieLinks.slice(0, 3)) { const href = await link.getAttribute('href'); const text = await link.textContent(); console.log(` - ${text}: ${href}`); } } catch (error) { console.error('Error:', error); } finally { await browser.close(); } } findDutchieMenu();