Files
cannaiq/backend/archive/debug-sol-flower.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

69 lines
1.9 KiB
TypeScript

import { chromium } from 'playwright';
async function debugSolFlower() {
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext();
const page = await context.newPage();
try {
// Set age gate bypass cookies
await context.addCookies([
{
name: 'age_verified',
value: 'true',
domain: '.dutchie.com',
path: '/',
},
{
name: 'initial_location',
value: JSON.stringify({ state: 'Arizona' }),
domain: '.dutchie.com',
path: '/',
},
]);
console.log('🌐 Loading Sol Flower Sun City shop page...');
await page.goto('https://dutchie.com/dispensary/sol-flower-dispensary/shop', {
waitUntil: 'networkidle',
});
console.log('📸 Taking screenshot...');
await page.screenshot({ path: '/tmp/sol-flower-shop.png', fullPage: true });
// Try to find products with various selectors
console.log('\n🔍 Looking for products with different selectors:');
const selectors = [
'a[href*="/product/"]',
'[data-testid="product-card"]',
'[data-testid="product"]',
'.product-card',
'.ProductCard',
'article',
'[role="article"]',
];
for (const selector of selectors) {
const count = await page.locator(selector).count();
console.log(` ${selector}: ${count} elements`);
}
// Get the page HTML to inspect
console.log('\n📄 Page title:', await page.title());
// Check if there's any text indicating no products
const bodyText = await page.locator('body').textContent();
if (bodyText?.includes('No products') || bodyText?.includes('no items')) {
console.log('⚠️ Page indicates no products available');
}
console.log('\n✅ Screenshot saved to /tmp/sol-flower-shop.png');
} catch (error) {
console.error('❌ Error:', error);
} finally {
await browser.close();
}
}
debugSolFlower();