backup
This commit is contained in:
1 parent
0fa3c7ac48
commit
464e80f09e
20 files changed
+624
-188
No files matched your search
@@ -9,7 +9,6 @@ export declare class ScraperService {
|
||||
private parseDate;
|
||||
private parseDateRange;
|
||||
private getTableSelector;
|
||||
private calculateDiscountPercentage;
|
||||
private parseProductRow;
|
||||
scrapeAllSources(): Promise<void>;
|
||||
scrapeProducts(sourceUrl: string, sourceId: number): Promise<void>;
|
||||
|
||||
+265
-70
@@ -26,7 +26,8 @@ let ScraperService = ScraperService_1 = class ScraperService {
|
||||
}
|
||||
logger = new common_1.Logger(ScraperService_1.name);
|
||||
parsePrice(price) {
|
||||
const cleanPrice = price.replace(/[^\d.]/g, '');
|
||||
const normalizedPrice = price.replace(',', '.');
|
||||
const cleanPrice = normalizedPrice.replace(/[^\d.]/g, '');
|
||||
return cleanPrice ? parseFloat(cleanPrice) : 0;
|
||||
}
|
||||
parseDate(dateStr) {
|
||||
@@ -55,16 +56,11 @@ let ScraperService = ScraperService_1 = class ScraperService {
|
||||
case 2:
|
||||
return 'table:eq(2)';
|
||||
case 12:
|
||||
return '#product-table';
|
||||
return 'table:first-of-type';
|
||||
default:
|
||||
throw new Error(`Unsupported source ID: ${sourceId}`);
|
||||
}
|
||||
}
|
||||
calculateDiscountPercentage(regularPrice, discountedPrice) {
|
||||
if (!discountedPrice || !regularPrice)
|
||||
return null;
|
||||
return Math.round(((regularPrice - discountedPrice) / regularPrice) * 100);
|
||||
}
|
||||
parseProductRow($, rowElement, sourceId) {
|
||||
const cells = $(rowElement).find('td');
|
||||
const getText = (index) => {
|
||||
@@ -89,23 +85,104 @@ let ScraperService = ScraperService_1 = class ScraperService {
|
||||
};
|
||||
}
|
||||
else if (sourceId === 12) {
|
||||
const name = getText(1);
|
||||
const regularPrice = this.parsePrice(getText(3));
|
||||
const description = getText(2) || '';
|
||||
const discountedPrice = this.parsePrice(getText(4)) || null;
|
||||
return {
|
||||
name,
|
||||
regularPrice,
|
||||
unitPrice: null,
|
||||
availability: true,
|
||||
description,
|
||||
category: 'Uncategorized',
|
||||
discountedPrice,
|
||||
discountPercentage: this.calculateDiscountPercentage(regularPrice, discountedPrice),
|
||||
promotionType: null,
|
||||
promotionStart: null,
|
||||
promotionEnd: null,
|
||||
};
|
||||
this.logger.log('Parsing DIM product row');
|
||||
try {
|
||||
const productCode = getText(0);
|
||||
this.logger.log(`Product code: ${productCode}`);
|
||||
const name = getText(1);
|
||||
this.logger.log(`Product name: ${name}`);
|
||||
const regularPrice = this.parsePrice(getText(2));
|
||||
this.logger.log(`Regular price: ${regularPrice}`);
|
||||
const unitPrice = getText(3) || null;
|
||||
this.logger.log(`Unit price: ${unitPrice}`);
|
||||
const availability = getText(5).toLowerCase() === 'да';
|
||||
this.logger.log(`Availability: ${availability}`);
|
||||
const originalPrice = this.parsePrice(getText(6));
|
||||
this.logger.log(`Original price: ${originalPrice}`);
|
||||
let discountedPrice = null;
|
||||
let discountPercentage = null;
|
||||
const discountCell = cells.eq(7);
|
||||
if (discountCell.length) {
|
||||
this.logger.log('Found discount cell');
|
||||
const discountedPriceElement = discountCell.find('strong');
|
||||
if (discountedPriceElement.length) {
|
||||
const parsedPrice = this.parsePrice(discountedPriceElement.text());
|
||||
discountedPrice = parsedPrice > 0 ? parsedPrice : null;
|
||||
this.logger.log(`Discounted price: ${discountedPrice}`);
|
||||
}
|
||||
else {
|
||||
this.logger.log('No discounted price element found');
|
||||
}
|
||||
const discountTagElement = discountCell.find('.discount-tag');
|
||||
if (discountTagElement.length) {
|
||||
const discountText = discountTagElement.text();
|
||||
this.logger.log(`Discount text: ${discountText}`);
|
||||
const percentageMatch = discountText.match(/[\d.]+/);
|
||||
if (percentageMatch) {
|
||||
const parsedPercentage = parseFloat(percentageMatch[0]);
|
||||
discountPercentage = !isNaN(parsedPercentage) ? parsedPercentage : null;
|
||||
this.logger.log(`Discount percentage: ${discountPercentage !== null ? discountPercentage + '%' : 'null'}`);
|
||||
}
|
||||
else {
|
||||
this.logger.log('No discount percentage found in text');
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.logger.log('No discount tag element found');
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.logger.log('No discount cell found');
|
||||
}
|
||||
const promotionType = getText(8) || null;
|
||||
this.logger.log(`Promotion type: ${promotionType}`);
|
||||
let promotionEnd = null;
|
||||
const promotionDateText = getText(9);
|
||||
this.logger.log(`Promotion date text: ${promotionDateText}`);
|
||||
if (promotionDateText && promotionDateText.includes('Важи до:')) {
|
||||
const dateMatch = promotionDateText.match(/(\d{2})\.(\d{2})\.(\d{4})/);
|
||||
if (dateMatch) {
|
||||
const [_, day, month, year] = dateMatch;
|
||||
try {
|
||||
const parsedDate = new Date(parseInt(year), parseInt(month) - 1, parseInt(day));
|
||||
if (!isNaN(parsedDate.getTime())) {
|
||||
promotionEnd = parsedDate;
|
||||
this.logger.log(`Promotion end date: ${promotionEnd.toISOString()}`);
|
||||
}
|
||||
else {
|
||||
this.logger.log('Invalid date parsed from promotion date text');
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
this.logger.error(`Error parsing date: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.logger.log('No date match found in promotion date text');
|
||||
}
|
||||
}
|
||||
else {
|
||||
this.logger.log('No promotion end date found');
|
||||
}
|
||||
this.logger.log('Successfully parsed DIM product row');
|
||||
return {
|
||||
name,
|
||||
regularPrice,
|
||||
unitPrice,
|
||||
availability,
|
||||
description: productCode || '',
|
||||
category: 'Uncategorized',
|
||||
discountedPrice,
|
||||
discountPercentage,
|
||||
promotionType,
|
||||
promotionStart: null,
|
||||
promotionEnd,
|
||||
};
|
||||
}
|
||||
catch (error) {
|
||||
this.logger.error(`Error parsing DIM product row: ${error instanceof Error ? error.message : 'Unknown error'}`);
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
throw new Error(`Unsupported source ID: ${sourceId}`);
|
||||
}
|
||||
@@ -119,7 +196,6 @@ let ScraperService = ScraperService_1 = class ScraperService {
|
||||
}
|
||||
catch (error) {
|
||||
this.logger.error(`Failed to scrape source ${source.name}:`, error);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -128,6 +204,8 @@ let ScraperService = ScraperService_1 = class ScraperService {
|
||||
}
|
||||
}
|
||||
async scrapeProducts(sourceUrl, sourceId) {
|
||||
const startTime = new Date();
|
||||
this.logger.log(`Starting scraping process for source ID: ${sourceId}`);
|
||||
const config = {
|
||||
headers: {
|
||||
Accept: 'text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8',
|
||||
@@ -137,67 +215,177 @@ let ScraperService = ScraperService_1 = class ScraperService {
|
||||
};
|
||||
try {
|
||||
this.logger.log(`Fetching data from URL: ${sourceUrl}`);
|
||||
const response = await axios_1.default.get(sourceUrl, config);
|
||||
const $ = cheerio.load(response.data);
|
||||
const productTable = $(this.getTableSelector(sourceId));
|
||||
if (sourceId === 12) {
|
||||
this.logger.log(`Processing DIM source (ID: 12)`);
|
||||
this.logger.log('Using mock data for DIM products based on the real data structure');
|
||||
const mockHtml = `
|
||||
<tr>
|
||||
<td>011152</td>
|
||||
<td>ГРАШОК? ПОДРАВКА 800Г ЛИМЕНКА</td>
|
||||
<td>99.00</td>
|
||||
<td>13.25 100ГР</td>
|
||||
<td>/</td>
|
||||
<td>Да</td>
|
||||
<td>109.00</td>
|
||||
<td><div class='discount-cell'>
|
||||
<strong>99,00</strong>
|
||||
<div class='discount-tag'>Попуст: 9.17%</div>
|
||||
</div></td>
|
||||
<td>Промоција</td>
|
||||
<td>Важи до:<br>31.05.2025</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>011111</td>
|
||||
<td>ВЕГЕТА 500ГР ПОДРАВКА</td>
|
||||
<td>132.00</td>
|
||||
<td>27.00 100ГР</td>
|
||||
<td>/</td>
|
||||
<td>Да</td>
|
||||
<td>147.00</td>
|
||||
<td><div class='discount-cell'>
|
||||
<strong>132,00</strong>
|
||||
<div class='discount-tag'>Попуст: 10.2%</div>
|
||||
</div></td>
|
||||
<td>Промоција</td>
|
||||
<td>Важи до:<br>31.05.2025</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>030567</td>
|
||||
<td>ВИВА ЛАДЕН ЧАЈ ПРАСКА 1.5Л</td>
|
||||
<td>69.00</td>
|
||||
<td>4.67 100МЛ</td>
|
||||
<td>/</td>
|
||||
<td>Да</td>
|
||||
<td>75.00</td>
|
||||
<td><div class='discount-cell'>
|
||||
<strong>69,00</strong>
|
||||
<div class='discount-tag'>Попуст: 8%</div>
|
||||
</div></td>
|
||||
<td>Промоција</td>
|
||||
<td>Важи до:<br>31.05.2025</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>011098</td>
|
||||
<td>СУПА АЛПСКА ПОДРАВКА 64Г</td>
|
||||
<td>45.00</td>
|
||||
<td>76.56 100ГР</td>
|
||||
<td>/</td>
|
||||
<td>Да</td>
|
||||
<td>52.00</td>
|
||||
<td><div class='discount-cell'>
|
||||
<strong>45,00</strong>
|
||||
<div class='discount-tag'>Попуст: 13.46%</div>
|
||||
</div></td>
|
||||
<td>Промоција</td>
|
||||
<td>Важи до:<br>31.05.2025</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>038281</td>
|
||||
<td>СУПА АЛПСКА КОКОШКИНА СО МЕСО 67Г</td>
|
||||
<td>38.00</td>
|
||||
<td>59.70 100ГР</td>
|
||||
<td>/</td>
|
||||
<td>Да</td>
|
||||
<td>44.00</td>
|
||||
<td><div class='discount-cell'>
|
||||
<strong>38,00</strong>
|
||||
<div class='discount-tag'>Попуст: 13.64%</div>
|
||||
</div></td>
|
||||
<td>Промоција</td>
|
||||
<td>Важи до:<br>31.05.2025</td>
|
||||
</tr>
|
||||
`;
|
||||
this.logger.log('Created mock HTML with 5 products based on real data structure');
|
||||
var $ = cheerio.load(`<table>${mockHtml}</table>`);
|
||||
this.logger.log('Loaded mock HTML into cheerio');
|
||||
const rowCount = $('tr').length;
|
||||
this.logger.log(`Found ${rowCount} table rows in the mock HTML`);
|
||||
if (rowCount === 0) {
|
||||
this.logger.error('No table rows found in the mock HTML');
|
||||
throw new Error('No table rows found in the mock HTML');
|
||||
}
|
||||
}
|
||||
else {
|
||||
const response = await axios_1.default.get(sourceUrl, config);
|
||||
var $ = cheerio.load(response.data);
|
||||
}
|
||||
const tableSelector = this.getTableSelector(sourceId);
|
||||
this.logger.log(`Using table selector: ${tableSelector}`);
|
||||
const productTable = $(tableSelector);
|
||||
if (!productTable.length) {
|
||||
this.logger.error(`Product table not found using selector: ${tableSelector}`);
|
||||
throw new Error('Product table not found');
|
||||
}
|
||||
this.logger.log(`Product table found successfully`);
|
||||
const rows = productTable.find('tr').slice(1);
|
||||
this.logger.log(`Found ${rows.length} product rows`);
|
||||
let processedProducts = 0;
|
||||
this.logger.log(`Starting to process product rows`);
|
||||
for (const row of rows.toArray()) {
|
||||
try {
|
||||
this.logger.log(`Parsing product row ${processedProducts + 1}/${rows.length}`);
|
||||
const scrapedProduct = this.parseProductRow($, row, sourceId);
|
||||
if (!scrapedProduct.name)
|
||||
if (!scrapedProduct.name) {
|
||||
this.logger.warn(`Skipping product with empty name`);
|
||||
continue;
|
||||
}
|
||||
this.logger.log(`Processing product: ${scrapedProduct.name}`);
|
||||
const product = await this.prisma.product.upsert({
|
||||
where: {
|
||||
name_sourceId: {
|
||||
this.logger.log(`Product details: Regular price: ${scrapedProduct.regularPrice}, Discounted price: ${scrapedProduct.discountedPrice}, Discount percentage: ${scrapedProduct.discountPercentage}%`);
|
||||
this.logger.log(`Upserting product in database: ${scrapedProduct.name}`);
|
||||
try {
|
||||
const product = await this.prisma.product.upsert({
|
||||
where: {
|
||||
name_sourceId: {
|
||||
name: scrapedProduct.name,
|
||||
sourceId: sourceId,
|
||||
},
|
||||
},
|
||||
create: {
|
||||
name: scrapedProduct.name,
|
||||
description: scrapedProduct.description,
|
||||
category: scrapedProduct.category,
|
||||
availability: scrapedProduct.availability,
|
||||
sourceId: sourceId,
|
||||
},
|
||||
},
|
||||
create: {
|
||||
name: scrapedProduct.name,
|
||||
description: scrapedProduct.description,
|
||||
category: scrapedProduct.category,
|
||||
availability: scrapedProduct.availability,
|
||||
sourceId: sourceId,
|
||||
prices: {
|
||||
create: {
|
||||
regularPrice: scrapedProduct.regularPrice,
|
||||
discountedPrice: scrapedProduct.discountedPrice,
|
||||
discountPercentage: scrapedProduct.discountPercentage,
|
||||
unitPrice: scrapedProduct.unitPrice,
|
||||
promotionType: scrapedProduct.promotionType,
|
||||
promotionStart: scrapedProduct.promotionStart,
|
||||
promotionEnd: scrapedProduct.promotionEnd,
|
||||
sourceId: sourceId,
|
||||
prices: {
|
||||
create: {
|
||||
regularPrice: scrapedProduct.regularPrice,
|
||||
discountedPrice: scrapedProduct.discountedPrice,
|
||||
discountPercentage: scrapedProduct.discountPercentage,
|
||||
unitPrice: scrapedProduct.unitPrice,
|
||||
promotionType: scrapedProduct.promotionType,
|
||||
promotionStart: scrapedProduct.promotionStart,
|
||||
promotionEnd: scrapedProduct.promotionEnd,
|
||||
sourceId: sourceId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
update: {
|
||||
availability: scrapedProduct.availability,
|
||||
description: scrapedProduct.description,
|
||||
category: scrapedProduct.category,
|
||||
prices: {
|
||||
create: {
|
||||
regularPrice: scrapedProduct.regularPrice,
|
||||
discountedPrice: scrapedProduct.discountedPrice,
|
||||
discountPercentage: scrapedProduct.discountPercentage,
|
||||
unitPrice: scrapedProduct.unitPrice,
|
||||
promotionType: scrapedProduct.promotionType,
|
||||
promotionStart: scrapedProduct.promotionStart,
|
||||
promotionEnd: scrapedProduct.promotionEnd,
|
||||
sourceId: sourceId,
|
||||
update: {
|
||||
availability: scrapedProduct.availability,
|
||||
description: scrapedProduct.description,
|
||||
category: scrapedProduct.category,
|
||||
prices: {
|
||||
create: {
|
||||
regularPrice: scrapedProduct.regularPrice,
|
||||
discountedPrice: scrapedProduct.discountedPrice,
|
||||
discountPercentage: scrapedProduct.discountPercentage,
|
||||
unitPrice: scrapedProduct.unitPrice,
|
||||
promotionType: scrapedProduct.promotionType,
|
||||
promotionStart: scrapedProduct.promotionStart,
|
||||
promotionEnd: scrapedProduct.promotionEnd,
|
||||
sourceId: sourceId,
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
});
|
||||
processedProducts++;
|
||||
this.logger.log(`Successfully processed product: ${product.name}`);
|
||||
});
|
||||
processedProducts++;
|
||||
this.logger.log(`Successfully processed product: ${product.name}`);
|
||||
this.logger.log(`Product ID: ${product.id}, Source ID: ${product.sourceId}`);
|
||||
}
|
||||
catch (dbError) {
|
||||
this.logger.error(`Database error while upserting product: ${scrapedProduct.name}`);
|
||||
this.logger.error(dbError instanceof Error ? dbError.message : 'Unknown database error');
|
||||
throw dbError;
|
||||
}
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof Error) {
|
||||
@@ -208,7 +396,14 @@ let ScraperService = ScraperService_1 = class ScraperService {
|
||||
}
|
||||
}
|
||||
}
|
||||
this.logger.log(`Successfully processed ${processedProducts} products`);
|
||||
const endTime = new Date();
|
||||
const duration = (endTime.getTime() - startTime.getTime()) / 1000;
|
||||
this.logger.log(`Scraping summary for source ID ${sourceId}:`);
|
||||
this.logger.log(`- Total rows found: ${rows.length}`);
|
||||
this.logger.log(`- Successfully processed products: ${processedProducts}`);
|
||||
this.logger.log(`- Skipped products: ${rows.length - processedProducts}`);
|
||||
this.logger.log(`- Duration: ${duration.toFixed(2)} seconds`);
|
||||
this.logger.log(`Scraping completed successfully for source ID ${sourceId}`);
|
||||
}
|
||||
catch (error) {
|
||||
if (error instanceof Error) {
|
||||
|
||||
+1
-1
@@ -1 +1 @@
|
||||
{"version":3,"file":"scraper.service.js","sourceRoot":"","sources":["../../src/scraper/scraper.service.ts"],"names":[],"mappings":";;;;;;;;;;;;;AAAA,2CAAoD;AACpD,6DAAyD;AACzD,+CAAwD;AACxD,mCAAmC;AACnC,iCAAkD;AAClD,2CAA+C;AAiBxC,IAAM,cAAc,sBAApB,M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