amazon-buddy
Advanced tools
Comparing version 2.2.40 to 2.2.41
@@ -405,3 +405,3 @@ const moment = require('moment'); | ||
price_format: (price) => { | ||
const formatedPrice = price.replace(/[^\d+\,]/g, '').replace(',', '.'); | ||
const formatedPrice = price.replace(/[^\d+\.]/g, ''); | ||
return parseFloat(formatedPrice); | ||
@@ -1053,3 +1053,61 @@ }, | ||
}, | ||
PL: { | ||
country: 'Poland', | ||
currency: 'Zł', | ||
symbol: 'zł', | ||
host: 'www.amazon.pl', | ||
variants: { | ||
split_text: 'Click to select ', | ||
}, | ||
best_seller: (text) => { | ||
if (text) { | ||
const match = text.match(/(#[\d,|]+) in[\s\n ]([\w&'\s]+)/); | ||
if (match) { | ||
return { rank: parseInt(match[1].replace(/[^\d]/g, '')), category: match[2].trim() }; | ||
} | ||
} | ||
return ''; | ||
}, | ||
review_date: (date) => { | ||
const dateRegex = /on (.+)$/.exec(date); | ||
if (dateRegex) { | ||
return { | ||
date: dateRegex[1], | ||
unix: moment(new Date(`${dateRegex[1]} 02:00:00`)) | ||
.utc() | ||
.unix(), | ||
}; | ||
} | ||
return ''; | ||
}, | ||
price_format: (price) => { | ||
const formatedPrice = price.replace(/[^\d+\,]/g, ''); | ||
return parseFloat(formatedPrice.replace(/,/g, '.')); | ||
}, | ||
product_information: { | ||
// <<------ NOT CORRECT! Requires translation of the {fields} key values. I don't have much time to do it | ||
id: [ | ||
'#detailBullets_feature_div > ul', | ||
'#productDetails_detailBullets_sections1', | ||
'#productDetails_techSpec_section_1', | ||
'#productDetails_techSpec_section_2', | ||
'#detailBulletsWrapper_feature_div > ul:nth-child(5)', | ||
], | ||
fields: { | ||
'Amazon Best Sellers Rank': { key: '', rank: true }, | ||
'Best-sellers rank': { key: '', rank: true }, | ||
'Best Sellers Rank': { key: '', rank: true }, | ||
'Package Dimensions': { key: 'dimensions' }, | ||
'Product Dimensions': { key: 'dimensions' }, | ||
'Parcel Dimensions': { key: 'dimensions' }, | ||
'Item Weight': { key: 'weight' }, | ||
Manufacturer: { key: 'manufacturer' }, | ||
'Release date': { key: 'available_from' }, | ||
'Date First Available': { key: 'available_from' }, | ||
'Item model number': { key: 'model_number' }, | ||
Department: { key: 'department' }, | ||
}, | ||
}, | ||
}, | ||
}, | ||
}; |
{ | ||
"name": "amazon-buddy", | ||
"version": "2.2.40", | ||
"version": "2.2.41", | ||
"description": "Amazon Scraper. You can scrape products from amazon search result and you can also scrape reviews from a specific product", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
170504
2838