Files
cannaiq/backend/archive/capture-age-gate-cookies.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

54 lines
1.6 KiB
TypeScript

import puppeteer from 'puppeteer-extra';
import StealthPlugin from 'puppeteer-extra-plugin-stealth';
import { writeFileSync } from 'fs';
puppeteer.use(StealthPlugin());
async function captureAgeGateCookies() {
const browser = await puppeteer.launch({
headless: false, // Visible browser so you can complete age gate manually
args: [
'--no-sandbox',
'--disable-setuid-sandbox',
'--disable-dev-shm-usage',
'--disable-blink-features=AutomationControlled'
]
});
const page = await browser.newPage();
await page.setViewport({ width: 1920, height: 1080 });
console.log('\n===========================================');
console.log('INSTRUCTIONS:');
console.log('1. A browser window will open');
console.log('2. Complete the age gate manually');
console.log('3. Wait until you see the store page load');
console.log('4. Press ENTER in this terminal when done');
console.log('===========================================\n');
await page.goto('https://curaleaf.com/stores/curaleaf-az-48th-street');
// Wait for user to complete age gate manually
await new Promise((resolve) => {
process.stdin.once('data', () => resolve(null));
});
// Get cookies after age gate
const cookies = await page.cookies();
console.log('\nCaptured cookies:', JSON.stringify(cookies, null, 2));
// Save cookies to file
writeFileSync(
'/home/kelly/dutchie-menus/backend/curaleaf-cookies.json',
JSON.stringify(cookies, null, 2)
);
console.log('\n✅ Cookies saved to curaleaf-cookies.json');
console.log('Current URL:', page.url());
await browser.close();
process.exit(0);
}
captureAgeGateCookies();