{
  "version": "1.0.0",
  "exported_at": "2026-06-01T12:45:00.000Z",
  "project": {
    "name": "Amazon Product Scraper for germany",
    "description": "Best-effort Amazon.de keyword product scraper equivalent to the Octoparse template. It scrapes keyword search results for 'weihnachten kerzen' using known search-result page URLs 1-10. The flow stops gracefully when a page has no product result rows, and appends all extracted pages to one fresh CSV file. Exports Keyword, ASIN, Title, Detail_Page_URL, Star_Rating, Number_of_Reviews, Price, and Current_Time. Edit navigate.urls to change keyword or page count. Amazon may block scraping with CAPTCHA/robot checks, cookie prompts, regional delivery restrictions, or missing price/rating fields.",
    "color": "bg-[#ff9900]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Resize browser window",
      "position_x": 120,
      "position_y": 260,
      "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": 260,
      "config": {
        "urls": [
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=1&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=2&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=3&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=4&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=5&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=6&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=7&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=8&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=9&language=en_GB",
          "https://www.amazon.de/s?k=weihnachten+kerzen&page=10&language=en_GB"
        ],
        "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": 840,
      "position_y": 260,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "selector": "#sp-cc-accept",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "selector": "#sp-cc-accept",
        "timeout": 8,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-3",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2280,
      "position_y": 600,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2640,
      "position_y": 600,
      "config": {
        "selector": "div.s-main-slot div[data-component-type=\"s-search-result\"][data-asin]:not([data-asin=\"\"])",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 3000,
      "position_y": 600,
      "config": {
        "rowSelector": "div.s-main-slot div[data-component-type=\"s-search-result\"][data-asin]:not([data-asin=\"\"])",
        "fileName": "amazon-produkt-scraper-results.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "Keyword",
            "selector": "(new URLSearchParams(window.location.search).get('k') || '').replace(/\\s+/g, '')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ASIN",
            "selector": "",
            "attribute": "data-asin"
          },
          {
            "name": "Title",
            "selector": "(() => { const h2 = ROW.querySelector('h2'); if (h2 && h2.innerText.trim()) return h2.innerText.trim(); const spans = Array.from(ROW.querySelectorAll('a[href*=\"/dp/\"], a[href*=\"/gp/product/\"]')).flatMap(a => Array.from(a.querySelectorAll('span')).map(s => (s.textContent || '').trim())).filter(t => t.length > 20 && !/sponsored|gesponsert/i.test(t)); if (spans.length) return spans[0]; const img = ROW.querySelector('img.s-image'); return img ? (img.getAttribute('alt') || '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Detail_Page_URL",
            "selector": "(() => { const a = Array.from(ROW.querySelectorAll('a[href]')).find(a => /\\/dp\\/|\\/gp\\/product\\//.test(a.href)); return a ? a.href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Star_Rating",
            "selector": ".a-icon-alt",
            "attribute": "text"
          },
          {
            "name": "Number_of_Reviews",
            "selector": "(() => { const links = Array.from(ROW.querySelectorAll('a[href*=\"customerReviews\"], a[href*=\"#customerReviews\"]')); for (const a of links) { const txt = (a.textContent || '').trim(); if (/^[\\d.,]+$/.test(txt)) return txt; const aria = a.getAttribute('aria-label') || ''; const m = aria.match(/([\\d.,]+)\\s+(?:ratings?|reviews?|Bewertungen?|Rezensionen?)/i); if (m) return m[1]; } const candidates = Array.from(ROW.querySelectorAll('span.a-size-base.s-underline-text, span.a-size-small.s-underline-text')).map(e => (e.textContent || '').trim()); for (const t of candidates) { if (/^[\\d.,]+$/.test(t)) return t; } 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, 16)",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3360,
      "position_y": 600,
      "config": {
        "duration": 2,
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 3720,
      "position_y": 600,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2640,
      "position_y": 920,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": "sleep-3",
      "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": "sleep-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-3",
      "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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "false",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "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": "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": 156,
      "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": 156,
      "width": 3200,
      "height": 636,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "sleep-3",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1128,
      "position_y": 156,
      "width": 2840,
      "height": 636,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "element-exists-2",
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2928,
      "position_y": 496,
      "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": 2568,
      "position_y": 816,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort Amazon.de keyword product scraper equivalent to the Octoparse template. It scrapes keyword search results for 'weihnachten kerzen' using known search-result page URLs 1-10. The flow stops gracefully when a page has no product result rows, and appends all extracted pages to one fresh CSV file. Exports Keyword, ASIN, Title, Detail_Page_URL, Star_Rating, Number_of_Reviews, Price, and Current_Time. Edit navigate.urls to change keyword or page count. Amazon may block scraping with CAPTCHA/robot checks, cookie prompts, regional delivery restrictions, or missing price/rating fields.",
      "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 `#sp-cc-accept`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1400,
      "position_y": 240,
      "width": 340,
      "height": 134,
      "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 `div.s-main-slot div[data-component-type=\"s-search-result\"][data-asin]:not([data-asin=\"\"])`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 580,
      "width": 340,
      "height": 160,
      "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, Title, Detail_Page_URL, Number_of_Reviews, Current_Time). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 3200,
      "position_y": 580,
      "width": 340,
      "height": 135,
      "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": 3920,
      "position_y": 580,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}