Initial commit - Dutchie dispensary scraper

This commit is contained in:
Kelly
2025-11-28 19:45:44 -07:00
commit 5757a8e9bd
23375 changed files with 3788799 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
import { chromium } from 'playwright';
const GOOGLE_UA = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36';
async function main() {
const browser = await chromium.launch({ headless: true });
const context = await browser.newContext({
userAgent: GOOGLE_UA
});
const page = await context.newPage();
try {
console.log('Loading menu page...');
await page.goto('https://best.treez.io/onlinemenu/?customerType=ADULT', {
waitUntil: 'networkidle',
timeout: 30000
});
await page.waitForTimeout(3000);
// Get first 3 menu items and inspect their HTML structure
const menuItems = await page.locator('.menu-item').all();
console.log(`\nFound ${menuItems.length} menu items. Inspecting first 3:\n`);
for (let i = 0; i < Math.min(3, menuItems.length); i++) {
const item = menuItems[i];
const html = await item.innerHTML();
const text = await item.textContent();
console.log(`\n========== ITEM ${i + 1} ==========`);
console.log('HTML:');
console.log(html);
console.log('\nText Content:');
console.log(text);
console.log('='.repeat(40));
}
} catch (error: any) {
console.error('Error:', error.message);
} finally {
await browser.close();
}
}
main().catch(console.error);