More changes than expected. Mobile version improvements & PWA
Build & Push Docker Images / test-backend (push) Successful in 44s
Build & Push Docker Images / test-frontend (push) Successful in 52s
Build & Push Docker Images / build-backend (push) Failing after 34s
Build & Push Docker Images / build-frontend (push) Failing after 30s
Build & Push Docker Images / test-backend (push) Successful in 44s
Build & Push Docker Images / test-frontend (push) Successful in 52s
Build & Push Docker Images / build-backend (push) Failing after 34s
Build & Push Docker Images / build-frontend (push) Failing after 30s
This commit is contained in:
@@ -0,0 +1,61 @@
|
||||
const puppeteer = require('puppeteer-extra');
|
||||
const StealthPlugin = require('puppeteer-extra-plugin-stealth');
|
||||
const fs = require('fs');
|
||||
|
||||
const scrapePromofarma = require('./src/promofarma');
|
||||
const scrapeAmazon = require('./src/amazon');
|
||||
const scrapeGoogleShopping = require('./src/googleshopping');
|
||||
const scrapeOpenFoodFacts = require('./src/openfoodfacts');
|
||||
|
||||
puppeteer.use(StealthPlugin());
|
||||
|
||||
// Default terms related to parapharmacy
|
||||
const QUERIES = [
|
||||
'crema hidratante cara',
|
||||
'ibuprofeno' // fallback basic test query
|
||||
];
|
||||
|
||||
async function run() {
|
||||
console.log('🚀 Starting Parapharmacy Scraper...');
|
||||
// Launching browser
|
||||
const browser = await puppeteer.launch({
|
||||
headless: 'new',
|
||||
args: ['--no-sandbox', '--disable-setuid-sandbox']
|
||||
});
|
||||
|
||||
const allResults = {};
|
||||
|
||||
for (const query of QUERIES) {
|
||||
console.log(`\n🔍 Searching for: "${query}"`);
|
||||
|
||||
// We run sequentially to be gentle on CPU and anti-bot systems
|
||||
const promofarmaResults = await scrapePromofarma(query, browser);
|
||||
console.log(` ✅ Promofarma: found ${promofarmaResults.length} items`);
|
||||
|
||||
const amazonResults = await scrapeAmazon(query, browser);
|
||||
console.log(` ✅ Amazon: found ${amazonResults.length} items`);
|
||||
|
||||
const googleShoppingResults = await scrapeGoogleShopping(query, browser);
|
||||
console.log(` ✅ Google Shopping: found ${googleShoppingResults.length} items`);
|
||||
|
||||
const ofFactsResults = await scrapeOpenFoodFacts(query, browser);
|
||||
console.log(` ✅ OpenFoodFacts: found ${ofFactsResults.length} items`);
|
||||
|
||||
allResults[query] = {
|
||||
promofarma: promofarmaResults,
|
||||
amazon: amazonResults,
|
||||
googleshopping: googleShoppingResults,
|
||||
openfoodfacts: ofFactsResults
|
||||
};
|
||||
}
|
||||
|
||||
await browser.close();
|
||||
|
||||
fs.writeFileSync('results.json', JSON.stringify(allResults, null, 2));
|
||||
console.log('\n💾 Scraping finished. Results saved to results.json');
|
||||
}
|
||||
|
||||
run().catch(err => {
|
||||
console.error("Critical Error during scraping:", err);
|
||||
process.exit(1);
|
||||
});
|
||||
Reference in New Issue
Block a user