Files
cannaiq/backend/archive/test-deeply-rooted.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

65 lines
1.9 KiB
TypeScript

import puppeteer from 'puppeteer-extra';
import StealthPlugin from 'puppeteer-extra-plugin-stealth';
import { bypassAgeGate, detectStateFromUrl } from './src/utils/age-gate';
import { Browser, Page } from 'puppeteer';
puppeteer.use(StealthPlugin());
async function testDeeplyRooted() {
let browser: Browser | null = null;
try {
const url = 'https://azdeeplyrooted.com/';
browser = await puppeteer.launch({
headless: 'new',
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 });
await page.setUserAgent('Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36');
console.log('Loading Deeply Rooted page...');
await page.goto(url, { waitUntil: 'domcontentloaded', timeout: 60000 });
await page.waitForTimeout(3000);
console.log('Bypassing age gate...');
const state = detectStateFromUrl(url);
await bypassAgeGate(page, state);
console.log('\nWaiting for Dutchie menu to load...');
await page.waitForTimeout(5000);
const pageInfo = await page.evaluate(() => {
return {
title: document.title,
url: window.location.href,
hasReactEnv: !!(window as any).reactEnv,
productCount: document.querySelectorAll('[data-testid="product-list-item"]').length
};
});
console.log('\n=== Deeply Rooted Results ===');
console.log('Title:', pageInfo.title);
console.log('URL:', pageInfo.url);
console.log('Has ReactEnv:', pageInfo.hasReactEnv);
console.log('Product cards found:', pageInfo.productCount);
await browser.close();
process.exit(0);
} catch (error) {
console.error('Error:', error);
if (browser) await browser.close();
process.exit(1);
}
}
testDeeplyRooted();