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>
This commit is contained in:
71
backend/archive/diagnose-curaleaf-page.ts
Normal file
71
backend/archive/diagnose-curaleaf-page.ts
Normal file
@@ -0,0 +1,71 @@
|
||||
import { chromium } from 'playwright';
|
||||
import { bypassAgeGatePlaywright } from './src/utils/age-gate-playwright';
|
||||
|
||||
async function diagnoseCuraleafPage() {
|
||||
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...');
|
||||
await page.goto('https://curaleaf.com/stores/curaleaf-dispensary-48th-street', {
|
||||
waitUntil: 'domcontentloaded'
|
||||
});
|
||||
await page.waitForTimeout(2000);
|
||||
|
||||
console.log('Bypassing age gate...');
|
||||
const bypassed = await bypassAgeGatePlaywright(page, 'Arizona');
|
||||
|
||||
if (!bypassed) {
|
||||
console.log('❌ Failed to bypass age gate');
|
||||
await browser.close();
|
||||
return;
|
||||
}
|
||||
|
||||
console.log('✅ Age gate bypassed!');
|
||||
console.log(`Current URL: ${page.url()}`);
|
||||
|
||||
await page.waitForTimeout(5000);
|
||||
|
||||
// Check page title
|
||||
const title = await page.title();
|
||||
console.log(`\nPage title: ${title}`);
|
||||
|
||||
// Check for "menu" or "shop" links
|
||||
const menuLinks = await page.locator('a:has-text("menu"), a:has-text("shop"), a:has-text("order")').count();
|
||||
console.log(`\nMenu/Shop links found: ${menuLinks}`);
|
||||
|
||||
if (menuLinks > 0) {
|
||||
const links = await page.locator('a:has-text("menu"), a:has-text("shop"), a:has-text("order")').all();
|
||||
console.log('\nMenu links:');
|
||||
for (const link of links.slice(0, 5)) {
|
||||
const text = await link.textContent();
|
||||
const href = await link.getAttribute('href');
|
||||
console.log(` - ${text}: ${href}`);
|
||||
}
|
||||
}
|
||||
|
||||
// Check body text
|
||||
const bodyText = await page.textContent('body') || '';
|
||||
console.log(`\nBody text length: ${bodyText.length} characters`);
|
||||
console.log(`Contains "menu": ${bodyText.toLowerCase().includes('menu')}`);
|
||||
console.log(`Contains "shop": ${bodyText.toLowerCase().includes('shop')}`);
|
||||
console.log(`Contains "product": ${bodyText.toLowerCase().includes('product')}`);
|
||||
console.log(`Contains "dutchie": ${bodyText.toLowerCase().includes('dutchie')}`);
|
||||
|
||||
// Take screenshot
|
||||
await page.screenshot({ path: '/tmp/curaleaf-diagnosed.png', fullPage: true });
|
||||
console.log('\n📸 Screenshot saved: /tmp/curaleaf-diagnosed.png');
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
} finally {
|
||||
await browser.close();
|
||||
}
|
||||
}
|
||||
|
||||
diagnoseCuraleafPage();
|
||||
Reference in New Issue
Block a user