chore: sync project files
This commit is contained in:
125
test_amazon.json
Executable file
125
test_amazon.json
Executable file
@@ -0,0 +1,125 @@
|
||||
{
|
||||
"test_config": {
|
||||
"store": "amazon",
|
||||
"url": "https://www.amazon.fr/dp/B0D4DX8PH3",
|
||||
"description": "Produit Amazon réel (UGREEN Chargeur) pour validation des sélecteurs CSS"
|
||||
},
|
||||
"selectors": {
|
||||
"title": {
|
||||
"type": "css",
|
||||
"selector": "#productTitle",
|
||||
"note": "Titre principal du produit, peut contenir des espaces en début/fin à nettoyer"
|
||||
},
|
||||
"price_whole": {
|
||||
"type": "css",
|
||||
"selector": "span.a-price-whole",
|
||||
"note": "Partie entière du prix (ex: 39)"
|
||||
},
|
||||
"price_fraction": {
|
||||
"type": "css",
|
||||
"selector": "span.a-price-fraction",
|
||||
"note": "Partie décimale du prix (ex: 98)"
|
||||
},
|
||||
"price_offscreen": {
|
||||
"type": "css",
|
||||
"selector": "span.a-price span.a-offscreen",
|
||||
"note": "Prix complet formaté dans un span caché (fallback, contient le prix avec devise)"
|
||||
},
|
||||
"currency": {
|
||||
"type": "css",
|
||||
"selector": "span.a-price-symbol",
|
||||
"note": "Symbole de devise (€, $, etc.)"
|
||||
},
|
||||
"stock": {
|
||||
"type": "css",
|
||||
"selector": "#availability span",
|
||||
"note": "Statut de disponibilité (En stock, Rupture de stock, etc.)"
|
||||
},
|
||||
"image_main": {
|
||||
"type": "css",
|
||||
"selector": "#landingImage",
|
||||
"attribute": "src",
|
||||
"note": "Image principale affichée (résolution moyenne)"
|
||||
},
|
||||
"image_hires": {
|
||||
"type": "css",
|
||||
"selector": "#landingImage",
|
||||
"attribute": "data-old-hires",
|
||||
"note": "Image haute résolution (souvent 1500px)"
|
||||
},
|
||||
"images_dynamic": {
|
||||
"type": "css",
|
||||
"selector": "#landingImage",
|
||||
"attribute": "data-a-dynamic-image",
|
||||
"note": "JSON contenant toutes les résolutions disponibles avec dimensions"
|
||||
},
|
||||
"description_bullets": {
|
||||
"type": "css",
|
||||
"selector": "ul.a-unordered-list.a-vertical.a-spacing-mini li span.a-list-item",
|
||||
"note": "Liste des points de description du produit (à extraire tous les li)"
|
||||
},
|
||||
"category": {
|
||||
"type": "css",
|
||||
"selector": "#wayfinding-breadcrumbs_feature_div",
|
||||
"note": "Fil d'Ariane / catégories du produit"
|
||||
},
|
||||
"asin": {
|
||||
"type": "regex",
|
||||
"pattern": "/dp/([A-Z0-9]{10})",
|
||||
"note": "Identifiant unique Amazon (ASIN) extrait de l'URL"
|
||||
},
|
||||
"price_rrp": {
|
||||
"type": "css",
|
||||
"selector": "span.srpPriceBlock span.a-price.a-text-price span.a-offscreen",
|
||||
"note": "Prix conseillé (RRP/MSRP) - OPTIONNEL, pas toujours présent",
|
||||
"optional": true
|
||||
},
|
||||
"price_savings_percent": {
|
||||
"type": "css",
|
||||
"selector": "span.srpSavingsPercentageBlock",
|
||||
"note": "Pourcentage de réduction (ex: -39%) - OPTIONNEL",
|
||||
"optional": true
|
||||
},
|
||||
"price_lowest_30days": {
|
||||
"type": "css",
|
||||
"selector": "span.basisPrice span.a-offscreen",
|
||||
"note": "Prix le plus bas des 30 derniers jours - OPTIONNEL",
|
||||
"optional": true
|
||||
},
|
||||
"review_rating": {
|
||||
"type": "css",
|
||||
"selector": "#acrPopover span.a-color-base",
|
||||
"note": "Note moyenne des avis (ex: 4.2) - Peut aussi être dans i.a-icon-star-mini span.a-icon-alt"
|
||||
},
|
||||
"review_count": {
|
||||
"type": "css",
|
||||
"selector": "#acrCustomerReviewText",
|
||||
"note": "Nombre total d'avis (ex: (840))"
|
||||
},
|
||||
"product_description": {
|
||||
"type": "css",
|
||||
"selector": "#productDescription p span",
|
||||
"note": "Description longue du produit - OPTIONNEL, peut contenir plusieurs paragraphes",
|
||||
"optional": true
|
||||
}
|
||||
},
|
||||
"test_data": {
|
||||
"valid_urls": [
|
||||
"https://www.amazon.fr/dp/B0D4DX8PH3",
|
||||
"https://www.amazon.fr/UGREEN-Chargeur-Induction-Compatible-Magnétique/dp/B0D4DX8PH3",
|
||||
"https://www.amazon.fr/gp/product/B0D4DX8PH3",
|
||||
"https://www.amazon.fr/dp/B0D4DX8PH3/ref=sr_1_1"
|
||||
],
|
||||
"expected_canonical": "https://www.amazon.fr/dp/B0D4DX8PH3",
|
||||
"expected_asin": "B0D4DX8PH3"
|
||||
},
|
||||
"notes": {
|
||||
"price_parsing": "Le prix Amazon est divisé en 3 parties: whole + fraction + symbol. Utiliser price_offscreen comme fallback.",
|
||||
"price_optional": "Prix conseillé (RRP), réduction (%) et prix le plus bas 30j sont OPTIONNELS - ne pas bloquer le scraping s'ils sont absents.",
|
||||
"images": "data-a-dynamic-image contient un JSON avec toutes les résolutions. Parser ce JSON pour obtenir la meilleure qualité.",
|
||||
"title": "Souvent entouré d'espaces/retours à la ligne, utiliser strip().",
|
||||
"description": "Les bullet points sont dans des li > span.a-list-item, extraire tous les éléments.",
|
||||
"reviews": "Note et nombre d'avis extraits de #averageCustomerReviews. Le nombre peut être entre parenthèses (840).",
|
||||
"product_description": "Description longue dans #productDescription - peut contenir du HTML, à nettoyer. Optionnel."
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user