{
  "version": "1.0.0",
  "exported_at": "2026-06-01T12:00:00.000Z",
  "project": {
    "name": "Amazon Product Listing Scraper for France",
    "description": "Scrapes Amazon.fr keyword search listing results for the keyword 'ordinateur', attempts to set French zipcode 75103 when the Amazon location modal is available, and exports keyword, ASIN, brand guess, title, result page URL, canonical Amazon detail page URL, star rating, review count, price, and scrape time. Pagination uses the Amazon search enabled 'Next' link and appends rows until no next page is found. Amazon may show bot checks, CAPTCHA, regional variations, or a changed location modal; in those cases some steps or fields may require adjustment.",
    "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": 220,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 456,
      "position_y": 220,
      "config": {
        "url": "https://www.amazon.fr/s?k=ordinateur&page=1&lo=list&qid=1764233743",
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "selector": "#nav-global-location-popover-link",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1464,
      "position_y": 520,
      "config": {
        "selector": "#nav-global-location-popover-link",
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1800,
      "position_y": 520,
      "config": {
        "duration": 2,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2136,
      "position_y": 520,
      "config": {
        "selector": "input#GLUXZipUpdateInput",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "type-text-1",
      "block_type": "process",
      "title": "Type Text",
      "description": "Type text into input field",
      "position_x": 2472,
      "position_y": 520,
      "config": {
        "selector": "input#GLUXZipUpdateInput",
        "text": "75103",
        "clearFirst": true,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "click-2",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 2808,
      "position_y": 520,
      "config": {
        "selector": "#GLUXZipUpdate, input[aria-labelledby='GLUXZipUpdate-announce']",
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3144,
      "position_y": 520,
      "config": {
        "duration": 3,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 3480,
      "position_y": 520,
      "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": 3816,
      "position_y": 520,
      "config": {
        "selector": "div[data-component-type='s-search-result'][data-asin]",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 4152,
      "position_y": 520,
      "config": {
        "rowSelector": "div[data-component-type='s-search-result'][data-asin]",
        "fileName": "amazon-produits-details-scraper-via-mot-cle-final.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "keyword",
            "selector": "new URL(window.location.href).searchParams.get('k') || 'ordinateur'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "asin",
            "selector": "",
            "attribute": "data-asin"
          },
          {
            "name": "brand",
            "selector": "(() => { const title = ROW.querySelector('h2 span')?.textContent?.trim() || ''; const m = title.match(/^([A-Za-z0-9][A-Za-z0-9+\\-.&']*)/); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "h2 span",
            "attribute": "text"
          },
          {
            "name": "resultat_page_url",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "detail_page_url",
            "selector": "(() => { const asin = ROW.getAttribute('data-asin') || ''; return asin ? `https://www.amazon.fr/dp/${asin}` : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "star_rating",
            "selector": "(() => { const el = ROW.querySelector('i.a-icon-star-small span.a-icon-alt, i.a-icon-star span.a-icon-alt, span.a-icon-alt'); return el ? el.textContent.trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "number_of_reviews",
            "selector": "(() => { const reviewLinks = Array.from(ROW.querySelectorAll('a[href*=\"customerReviews\"], a[href*=\"product-reviews\"], a[href*=\"#customerReviews\"]')); for (const a of reviewLinks) { const values = [a.getAttribute('aria-label') || '', a.textContent || '']; for (const raw of values) { const txt = raw.trim(); if (!txt || /out of|stars|étoiles/i.test(txt)) continue; const m = txt.match(/[\\d][\\d\\s.,]*/); if (m) return m[0].replace(/[^\\d]/g, ''); } } const ariaCandidates = Array.from(ROW.querySelectorAll('a[aria-label], span[aria-label]')).map(el => el.getAttribute('aria-label') || '').filter(Boolean); for (const txt of ariaCandidates) { if (/^\\s*[\\d\\s.,]+\\s*$/.test(txt)) return txt.replace(/[^\\d]/g, ''); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": ".a-price .a-offscreen",
            "attribute": "text"
          },
          {
            "name": "current_time",
            "selector": "new Date().toISOString().replace('T', ' ').slice(0, 19)",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-exists-3",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 4488,
      "position_y": 520,
      "config": {
        "selector": "a.s-pagination-next:not(.s-pagination-disabled)",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 4488,
      "position_y": 520,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "click-3",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 4824,
      "position_y": 520,
      "config": {
        "selector": "a.s-pagination-next:not(.s-pagination-disabled)",
        "timeout": 15,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-page-load-3",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 5160,
      "position_y": 520,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-3",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 5496,
      "position_y": 520,
      "config": {
        "duration": 2,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 5832,
      "position_y": 758,
      "config": {
        "selector": "div[data-component-type='s-search-result'][data-asin]",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    }
  ],
  "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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-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": "element-exists-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "true",
      "to_block_id": "type-text-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "false",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "type-text-1",
      "from_connector_id": "right",
      "to_block_id": "click-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-2",
      "from_connector_id": "right",
      "to_block_id": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-2",
      "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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "element-exists-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-3",
      "from_connector_id": "false",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-3",
      "from_connector_id": "true",
      "to_block_id": "click-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-3",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-3",
      "from_connector_id": "right",
      "to_block_id": "sleep-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-3",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-2",
      "from_connector_id": "right",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 116,
      "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": 384,
      "position_y": 116,
      "width": 5696,
      "height": 834,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "sleep-2",
          "wait-for-page-load-2",
          "wait-for-element-1",
          "wait-for-page-load-3",
          "sleep-3",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1056,
      "position_y": 116,
      "width": 4016,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "element-exists-2",
          "click-2",
          "element-exists-3",
          "click-3"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 2400,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "type-text-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 4080,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 4416,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Amazon.fr keyword search listing results for the keyword 'ordinateur', attempts to set French zipcode 75103 when the Amazon location modal is available, and exports keyword, ASIN, brand guess, title, result page URL, canonical Amazon detail page URL, star rating, review count, price, and scrape time. Pagination uses the Amazon search enabled 'Next' link and appends rows until no next page is found. Amazon may show bot checks, CAPTCHA, regional variations, or a changed location modal; in those cases some steps or fields may require adjustment.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `#nav-global-location-popover-link`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1328,
      "position_y": 200,
      "width": 340,
      "height": 141,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-element-exists-2",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `input#GLUXZipUpdateInput`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2336,
      "position_y": 500,
      "width": 340,
      "height": 138,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-2"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (keyword, brand, resultat_page_url, detail_page_url, star_rating). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 4352,
      "position_y": 500,
      "width": 340,
      "height": 135,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-3",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `a.s-pagination-next:not(.s-pagination-disabled)`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 4688,
      "position_y": 500,
      "width": 340,
      "height": 146,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-3"
      }
    },
    {
      "id": "note-block-click-3",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Pagination click — add waits after this block; the page reloads asynchronously.",
      "color": "#ee5396",
      "position_x": 5024,
      "position_y": 500,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-3"
      }
    }
  ]
}