36 lines
1.0 KiB
TypeScript
36 lines
1.0 KiB
TypeScript
import { scrapeStore } from './src/services/scraper';
|
|
|
|
async function testSolFlowerScraper() {
|
|
console.log('🛍️ Testing product scraper for Sol Flower - Sun City\n');
|
|
|
|
try {
|
|
const storeId = 19; // Sol Flower - Sun City
|
|
console.log(`Store ID: ${storeId}\n`);
|
|
|
|
const result = await scrapeStore(storeId);
|
|
|
|
console.log('\n📊 Scraping Results:');
|
|
console.log(`Success: ${result.success ? '✅' : '❌'}`);
|
|
|
|
if (result.success) {
|
|
console.log(`\nProducts scraped: ${result.productsScraped || 0}`);
|
|
console.log(`Brands found: ${result.brandsFound || 0}`);
|
|
console.log(`Categories scraped: ${result.categoriesScraped || 0}`);
|
|
|
|
if (result.errors && result.errors.length > 0) {
|
|
console.log(`\nErrors encountered: ${result.errors.length}`);
|
|
result.errors.forEach((error, idx) => {
|
|
console.log(` ${idx + 1}. ${error}`);
|
|
});
|
|
}
|
|
} else {
|
|
console.log(`\nError: ${result.error}`);
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error:', error);
|
|
}
|
|
}
|
|
|
|
testSolFlowerScraper();
|