Files
cannaiq/backend/archive/find-dutchie-menu-curaleaf.ts
Kelly d91c55a344 feat: Add stale process monitor, users route, landing page, archive old scripts
- Add backend stale process monitoring API (/api/stale-processes)
- Add users management route
- Add frontend landing page and stale process monitor UI on /scraper-tools
- Move old development scripts to backend/archive/
- Update frontend build with new features

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-05 04:07:31 -07:00

62 lines
2.0 KiB
TypeScript

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();