{
  "version": "1.0.0",
  "exported_at": "2026-06-01T00:00:00.000Z",
  "project": {
    "name": "Amazon Product Details Scraper France",
    "description": "Scrapes Amazon.fr product detail pages from an editable ASIN/URL list. Navigation strategy: known product-detail URL list using navigate.urls, then wait for #productTitle, export one product row per page with fileMode append, and loop-continue to process every supplied ASIN URL. Best effort: Amazon may block automated traffic with CAPTCHA, bot checks, geo/language variations, unavailable offers, or changed product-page layouts. This version cleans hidden Amazon JSON/CSS from availability and keeps product information on one CSV line.",
    "color": "bg-[#ff9900]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser window dimensions",
      "position_x": 120,
      "position_y": 240,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 480,
      "position_y": 240,
      "config": {
        "urls": [
          "https://www.amazon.fr/dp/B0DBHRWRKC",
          "https://www.amazon.fr/dp/B09VM49K86",
          "https://www.amazon.fr/dp/B0CX4F3217"
        ],
        "color": "bg-[#08bdba]",
        "tags": [
          "amazon",
          "asin-input",
          "multi-url"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 840,
      "position_y": 240,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "selector": "#productTitle",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "rowSelector": "body",
        "fileName": "amazon-produits-details-scraper-via-asin.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "tags": [
          "product-details",
          "js-columns"
        ],
        "columns": [
          {
            "name": "asin",
            "selector": "(() => { const m = location.pathname.match(/\\/dp\\/([A-Z0-9]{10})|\\/gp\\/product\\/([A-Z0-9]{10})/i); const urlAsin = m ? (m[1] || m[2]) : ''; const tableAsin = Array.from(document.querySelectorAll('#productDetails_detailBullets_sections1 tr, #productDetails_techSpec_section_1 tr, #detailBullets_feature_div li')).map(el => el.innerText.trim()).find(t => /^ASIN\\b/i.test(t) || /\\bASIN\\b/i.test(t)); const fromTable = tableAsin ? tableAsin.replace(/^ASIN\\s*[:\\n]?\\s*/i, '').replace(/\\s+/g, ' ').trim() : ''; return urlAsin || fromTable; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "web_page_url",
            "selector": "(() => location.href.split('?')[0])()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "#productTitle",
            "attribute": "text"
          },
          {
            "name": "brand",
            "selector": "(() => { const byline = document.querySelector('#bylineInfo')?.textContent?.trim(); if (byline) return byline.replace(/\\s+/g, ' '); const rows = Array.from(document.querySelectorAll('#productOverview_feature_div tr, table.a-normal tr, #detailBullets_feature_div li')); for (const row of rows) { const txt = row.innerText.replace(/\\s+/g, ' ').trim(); if (/^(Brand|Brand Name|Marque|Nom de marque)\\b/i.test(txt)) return txt.replace(/^(Brand|Brand Name|Marque|Nom de marque)\\s*[:\\n]?\\s*/i, '').trim(); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "star_rating",
            "selector": "(() => { const s = document.querySelector('#acrPopover .a-icon-alt, #averageCustomerReviews .a-icon-alt, [data-hook=\"rating-out-of-text\"]')?.textContent?.trim(); return s ? s.replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "number_of_reviews",
            "selector": "(() => { const s = document.querySelector('#acrCustomerReviewText, #acrCustomerReviewLink span, [data-hook=\"total-review-count\"]')?.textContent?.trim(); return s ? s.replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const sels = ['#corePriceDisplay_desktop_feature_div .a-price .a-offscreen', '#corePrice_feature_div .a-price .a-offscreen', '#apex_desktop .a-price .a-offscreen', '#priceblock_ourprice', '#priceblock_dealprice', '#price_inside_buybox']; for (const sel of sels) { const el = document.querySelector(sel); const txt = el?.textContent?.trim(); if (txt) return txt.replace(/\\s+/g, ' '); } const price = Array.from(document.querySelectorAll('.a-price .a-offscreen')).map(e => e.textContent.trim()).find(Boolean); return price || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "style",
            "selector": "(() => { const txt = Array.from(document.querySelectorAll('#variation_style_name .selection, #variation_size_name .selection, #twister .selection')).map(e => e.textContent.trim()).filter(Boolean).join(' | '); if (txt) return txt; const rows = Array.from(document.querySelectorAll('#productOverview_feature_div tr, #productDetails_techSpec_section_1 tr, #detailBullets_feature_div li')); for (const row of rows) { const t = row.innerText.replace(/\\s+/g, ' ').trim(); if (/^(Style|Style Name|Modèle|Format)\\b/i.test(t)) return t.replace(/^(Style|Style Name|Modèle|Format)\\s*[:\\n]?\\s*/i, '').trim(); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "color",
            "selector": "(() => { const c = document.querySelector('#variation_color_name .selection')?.textContent?.trim(); if (c) return c; const rows = Array.from(document.querySelectorAll('#productOverview_feature_div tr, #productDetails_techSpec_section_1 tr, #detailBullets_feature_div li')); for (const row of rows) { const t = row.innerText.replace(/\\s+/g, ' ').trim(); if (/^(Colour|Color|Couleur)\\b/i.test(t)) return t.replace(/^(Colour|Color|Couleur)\\s*[:\\n]?\\s*/i, '').trim(); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "inventory",
            "selector": "(() => { const clean = el => { if (!el) return ''; const clone = el.cloneNode(true); clone.querySelectorAll('script, style, noscript, template').forEach(n => n.remove()); return clone.textContent.replace(/\\s+/g, ' ').trim(); }; const selectors = ['#availability .a-color-success', '#availability .a-color-state', '#availability span', '#availability', '#outOfStock .a-color-price', '#outOfStock', '#availabilityInsideBuyBox_feature_div']; for (const sel of selectors) { const val = clean(document.querySelector(sel)); if (val && !/^\\{/.test(val) && !/isInternal|showInsightsHub|availableFaceouts|availabilityMoreDetailsIcon/.test(val)) return val; } const body = document.body.innerText; const m = body.match(/(In stock|Only \\d+ left in stock|Currently unavailable|En stock|Actuellement indisponible|Temporairement en rupture de stock)/i); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "seller",
            "selector": "(() => { const merchant = document.querySelector('#sellerProfileTriggerId')?.textContent?.trim() || document.querySelector('#merchant-info a, #merchant-info')?.textContent?.trim() || document.querySelector('#tabular-buybox-container .tabular-buybox-text[tabular-attribute-name=\"Sold by\"]')?.textContent?.trim(); if (merchant) return merchant.replace(/\\s+/g, ' '); const txt = document.body.innerText; const m = txt.match(/(?:Sold by|Seller|Vendeur|Expédié par|Shipper\\s*\\/\\s*Seller)\\s+([^\\n]{2,80})/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "bullet_points",
            "selector": "(() => Array.from(document.querySelectorAll('#feature-bullets ul li:not(.aok-hidden), #featurebullets_feature_div ul li:not(.aok-hidden)')).map(li => li.innerText.replace(/\\s+/g, ' ').trim()).filter(t => t && !/^›/.test(t) && !/See more product details/i.test(t)).join(' | '))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_information",
            "selector": "(() => { const pairs = []; const add = (k, v) => { k = (k || '').replace(/\\s+/g, ' ').replace(/[:：]$/, '').trim(); v = (v || '').replace(/\\s+/g, ' ').trim(); if (k && v && !pairs.some(p => p.startsWith('\"' + k + '\"'))) pairs.push('\"' + k + '\": \"' + v.replace(/\"/g, '\\\\\"') + '\"'); }; document.querySelectorAll('#productOverview_feature_div tr, #productDetails_techSpec_section_1 tr, #productDetails_detailBullets_sections1 tr, table.prodDetTable tr').forEach(tr => { const cells = tr.querySelectorAll('th,td'); if (cells.length >= 2) add(cells[0].innerText, cells[1].innerText); }); document.querySelectorAll('#detailBullets_feature_div li').forEach(li => { const bold = li.querySelector('.a-text-bold'); if (bold) { const k = bold.innerText; const v = li.innerText.replace(k, ''); add(k, v); } }); return pairs.join(' | '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_description",
            "selector": "(() => { const sels = ['#productDescription', '#aplus', '#aplus_feature_div', '#bookDescription_feature_div']; for (const sel of sels) { const el = document.querySelector(sel); const txt = el?.innerText?.replace(/\\s+/g, ' ')?.trim(); if (txt) return txt; } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "item_model_number",
            "selector": "(() => { const labels = [/Item model number/i, /Model Number/i, /Model Name/i, /Numéro du modèle/i, /Numéro du modèle de l.article/i]; const rows = Array.from(document.querySelectorAll('#productDetails_detailBullets_sections1 tr, #productDetails_techSpec_section_1 tr, table.prodDetTable tr, #detailBullets_feature_div li')); for (const row of rows) { const txt = row.innerText.replace(/\\s+/g, ' ').trim(); for (const re of labels) { if (re.test(txt)) return txt.replace(re, '').replace(/^\\s*[:：-]?\\s*/, '').trim(); } } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_dimensions",
            "selector": "(() => { const labels = [/Product Dimensions/i, /Item Dimensions/i, /Dimensions du produit/i, /Dimensions/i]; const rows = Array.from(document.querySelectorAll('#productDetails_detailBullets_sections1 tr, #productDetails_techSpec_section_1 tr, table.prodDetTable tr, #detailBullets_feature_div li')); for (const row of rows) { const txt = row.innerText.replace(/\\s+/g, ' ').trim(); for (const re of labels) { if (re.test(txt)) return txt.replace(re, '').replace(/^\\s*[:：-]?\\s*/, '').trim(); } } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "date_first_available",
            "selector": "(() => { const labels = [/Date First Available/i, /Date de mise en ligne sur Amazon\\.fr/i, /Date de mise en ligne/i]; const rows = Array.from(document.querySelectorAll('#productDetails_detailBullets_sections1 tr, #productDetails_techSpec_section_1 tr, table.prodDetTable tr, #detailBullets_feature_div li')); for (const row of rows) { const txt = row.innerText.replace(/\\s+/g, ' ').trim(); for (const re of labels) { if (re.test(txt)) return txt.replace(re, '').replace(/^\\s*[:：-]?\\s*/, '').trim(); } } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_time",
            "selector": "(() => { const d = new Date(); const pad = n => String(n).padStart(2, '0'); return d.getFullYear() + '/' + pad(d.getMonth() + 1) + '/' + pad(d.getDate()) + ' ' + pad(d.getHours()) + ':' + pad(d.getMinutes()) + ':' + pad(d.getSeconds()); })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "color": "bg-[#8d8d8d]",
        "tags": [
          "continue-url-loop"
        ]
      }
    }
  ],
  "connections": [
    {
      "from_block_id": "set-window-size-1",
      "from_connector_id": "right",
      "to_block_id": "navigate-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "navigate-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-1",
      "from_connector_id": "right",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "set-window-size-1"
        ]
      }
    },
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 408,
      "position_y": 136,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 2208,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Amazon.fr product detail pages from an editable ASIN/URL list. Navigation strategy: known product-detail URL list using navigate.urls, then wait for #productTitle, export one product row per page with fileMode append, and loop-continue to process every supplied ASIN URL. Best effort: Amazon may block automated traffic with CAPTCHA, bot checks, geo/language variations, unavailable offers, or changed product-page layouts. This version cleans hidden Amazon JSON/CSS from availability and keeps product information on one CSV line.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-navigate-1",
      "element_type": "note",
      "title": "Note: Navigate",
      "content": "Multi-URL loop over 3 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "position_y": 220,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (asin, web_page_url, brand, star_rating, number_of_reviews). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 220,
      "width": 340,
      "height": 133,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-loop-continue-1",
      "element_type": "note",
      "title": "Note: Loop Continue",
      "content": "Loop Continue advances a multi-URL or multi-text loop. Place at the end of the loop body with a clear back-edge to the loop start.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}