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:
56
backend/archive/debug-product-card.ts
Normal file
56
backend/archive/debug-product-card.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
import { firefox } from 'playwright';
|
||||
import { getRandomProxy } from './src/utils/proxyManager.js';
|
||||
|
||||
async function debugProductCard() {
|
||||
const proxy = await getRandomProxy();
|
||||
if (!proxy) {
|
||||
console.log('No proxy available');
|
||||
process.exit(1);
|
||||
}
|
||||
|
||||
const browser = await firefox.launch({ headless: true });
|
||||
const context = await browser.newContext({
|
||||
viewport: { width: 1920, height: 1080 },
|
||||
userAgent: 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36',
|
||||
proxy: {
|
||||
server: proxy.server,
|
||||
username: proxy.username,
|
||||
password: proxy.password
|
||||
}
|
||||
});
|
||||
|
||||
const page = await context.newPage();
|
||||
|
||||
const brandUrl = 'https://dutchie.com/embedded-menu/AZ-Deeply-Rooted/brands/alien-labs';
|
||||
console.log(`Loading: ${brandUrl}`);
|
||||
|
||||
await page.goto(brandUrl, { waitUntil: 'domcontentloaded', timeout: 60000 });
|
||||
await page.waitForTimeout(3000);
|
||||
|
||||
// Get the first product card's full text content
|
||||
const cardData = await page.evaluate(() => {
|
||||
const card = document.querySelector('a[href*="/product/"]');
|
||||
if (!card) return null;
|
||||
|
||||
return {
|
||||
href: card.getAttribute('href'),
|
||||
innerHTML: card.innerHTML.substring(0, 2000),
|
||||
textContent: card.textContent?.substring(0, 1000)
|
||||
};
|
||||
});
|
||||
|
||||
console.log('\n' + '='.repeat(80));
|
||||
console.log('FIRST PRODUCT CARD DATA:');
|
||||
console.log('='.repeat(80));
|
||||
console.log('\nHREF:', cardData?.href);
|
||||
console.log('\nTEXT CONTENT:');
|
||||
console.log(cardData?.textContent);
|
||||
console.log('\nHTML (first 2000 chars):');
|
||||
console.log(cardData?.innerHTML);
|
||||
console.log('='.repeat(80));
|
||||
|
||||
await browser.close();
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
debugProductCard().catch(console.error);
|
||||
Reference in New Issue
Block a user