{
  "version": "1.0.0",
  "exported_at": "2026-06-01T11:30:00.000Z",
  "project": {
    "name": "Amazon Product Scraper by Keywords",
    "description": "Scrapes Amazon.de product search results for keyword 'Sportschuhe' with best-effort ZIP setup for 10243 Berlin. Extracts website, address/location text, keyword, page, product name, badge, product URL, ASIN, rating, review count, review URL, current price, original price, image URL, and delivery text. Pagination is handled by clicking Amazon's enabled Next button until no further page exists; results are appended to one CSV. Amazon may block scraping with CAPTCHA/bot checks or change selectors.",
    "color": "bg-[#ff9900]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 220,
      "config": {
        "url": "https://www.amazon.de/-/en/",
        "color": "bg-[#4589ff]",
        "tags": [
          "amazon",
          "setup",
          "zip"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 456,
      "position_y": 220,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "selector": "#nav-global-location-popover-link, #nav-global-location-slot a"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1128,
      "position_y": 520,
      "config": {
        "selector": "#nav-global-location-popover-link, #nav-global-location-slot a",
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1464,
      "position_y": 520,
      "config": {
        "selector": "#GLUXZipUpdateInput",
        "timeout": 20,
        "visible": true
      }
    },
    {
      "block_id": "type-text-1",
      "block_type": "process",
      "title": "Type Text",
      "description": "Type text into input",
      "position_x": 1800,
      "position_y": 520,
      "config": {
        "selector": "#GLUXZipUpdateInput",
        "text": "10243",
        "clearFirst": true
      }
    },
    {
      "block_id": "click-2",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 2136,
      "position_y": 520,
      "config": {
        "selector": "#GLUXZipUpdate, input[aria-labelledby='GLUXZipUpdate-announce']",
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2472,
      "position_y": 520,
      "config": {
        "duration": 3
      }
    },
    {
      "block_id": "navigate-2",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 2808,
      "position_y": 520,
      "config": {
        "url": "https://www.amazon.de/s?k=Sportschuhe&language=en_GB",
        "color": "bg-[#08bdba]",
        "tags": [
          "amazon",
          "search",
          "keyword"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 3144,
      "position_y": 520,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 3480,
      "position_y": 520,
      "config": {
        "selector": "div.s-main-slot div[data-component-type='s-search-result'][data-asin]:not([data-asin=''])",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 3816,
      "position_y": 520,
      "config": {
        "rowSelector": "div.s-main-slot div[data-component-type='s-search-result'][data-asin]:not([data-asin=''])",
        "fileName": "amazon-produkt-scraper-mit-schluesselwoerter.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "webseite",
            "selector": "(() => { return location.hostname.replace(/^www[.]/, ''); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "adresse",
            "selector": "(() => { return (document.querySelector('#glow-ingress-line2')?.textContent || document.querySelector('#nav-global-location-slot')?.textContent || '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "schluesselwort",
            "selector": "(() => { return new URLSearchParams(location.search).get('k') || 'Sportschuhe'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "seite",
            "selector": "(() => { return new URLSearchParams(location.search).get('page') || document.querySelector('.s-pagination-selected')?.textContent.trim() || '1'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "produktname",
            "selector": "(() => { return (ROW.querySelector('h2 span')?.textContent || ROW.querySelector('[data-cy=\"title-recipe\"] span')?.textContent || '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "badge",
            "selector": "(() => { return (ROW.querySelector('.a-badge-text')?.textContent || ROW.querySelector('.puis-badge-container span')?.textContent || ROW.querySelector('.s-label-popover-default span')?.textContent || '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "produktseite",
            "selector": "(() => { const a = ROW.querySelector('h2 a, a[href*=\"/dp/\"], a[href*=\"/sspa/click\"]'); return a ? new URL(a.getAttribute('href'), location.origin).href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "asin",
            "selector": "(() => { const direct = ROW.getAttribute('data-asin') || ''; if (direct) return direct; const a = ROW.querySelector('h2 a, a[href*=\"/dp/\"]'); const href = a ? new URL(a.getAttribute('href'), location.origin).href : ''; const part = href.split('/dp/')[1] || ''; return part.slice(0, 10); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "kundenbewertung",
            "selector": "(() => { return (ROW.querySelector('i[class*=\"a-icon-star\"] span.a-icon-alt')?.textContent || ROW.querySelector('span.a-icon-alt')?.textContent || '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "anzahl_der_bewertungen",
            "selector": "(() => { const values = Array.from(ROW.querySelectorAll('a[href*=\"customerReviews\"] span, a[href*=\"#customerReviews\"] span')).map(e => e.textContent.replace(/\\s+/g, ' ').trim()).filter(Boolean); return values.find(t => /^[0-9.,]+$/.test(t)) || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rezensionsseite",
            "selector": "(() => { const a = ROW.querySelector('h2 a, a[href*=\"/dp/\"], a[href*=\"/sspa/click\"]'); const url = a ? new URL(a.getAttribute('href'), location.origin).href : ''; return url ? url.split('#')[0] + '#customerReviews' : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "aktueller_preis",
            "selector": "(() => { return (ROW.querySelector('.a-price:not(.a-text-price) .a-offscreen')?.textContent || ROW.querySelector('.a-price .a-offscreen')?.textContent || '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "urspruenglicher_preis",
            "selector": "(() => { return (ROW.querySelector('.a-price.a-text-price .a-offscreen')?.textContent || ROW.querySelector('[data-a-strike=\"true\"] .a-offscreen')?.textContent || '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "bild",
            "selector": "(() => { return ROW.querySelector('img.s-image')?.src || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "gratis_lieferung",
            "selector": "(() => { const texts = Array.from(ROW.querySelectorAll('.a-row, span.a-color-base, span.a-color-secondary')).map(e => e.textContent.replace(/\\s+/g, ' ').trim()).filter(t => t && t.length < 120); return texts.find(t => /(delivery|lieferung|delivered|zustellung|free|gratis|morgen|today|tomorrow|mai|juni|jun|jul|aug|sep|okt|nov|dez|monday|tuesday|wednesday|thursday|friday|saturday|sunday)/i.test(t)) || ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 4152,
      "position_y": 520,
      "config": {
        "selector": "a.s-pagination-next:not(.s-pagination-disabled)"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 4152,
      "position_y": 520,
      "config": {}
    },
    {
      "block_id": "click-3",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 4488,
      "position_y": 520,
      "config": {
        "selector": "a.s-pagination-next:not(.s-pagination-disabled)",
        "timeout": 15
      }
    },
    {
      "block_id": "wait-for-page-load-3",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 4824,
      "position_y": 520,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 5160,
      "position_y": 520,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "wait-for-element-3",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 5496,
      "position_y": 758,
      "config": {
        "selector": "div.s-main-slot div[data-component-type='s-search-result'][data-asin]:not([data-asin=''])",
        "timeout": 30,
        "visible": true
      }
    }
  ],
  "connections": [
    {
      "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": "click-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": "type-text-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-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-1",
      "from_connector_id": "right",
      "to_block_id": "navigate-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "navigate-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "navigate-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-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"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "element-exists-2",
      "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": "element-exists-2",
      "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-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-3",
      "from_connector_id": "right",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 116,
      "width": 5696,
      "height": 834,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1",
          "navigate-2",
          "wait-for-page-load-2",
          "wait-for-element-2",
          "wait-for-page-load-3",
          "sleep-2",
          "wait-for-element-3"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 720,
      "position_y": 116,
      "width": 4016,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "click-2",
          "element-exists-2",
          "click-3"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1728,
      "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": 3744,
      "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": 4080,
      "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.de product search results for keyword 'Sportschuhe' with best-effort ZIP setup for 10243 Berlin. Extracts website, address/location text, keyword, page, product name, badge, product URL, ASIN, rating, review count, review URL, current price, original price, image URL, and delivery text. Pagination is handled by clicking Amazon's enabled Next button until no further page exists; results are appended to one CSV. Amazon may block scraping with CAPTCHA/bot checks or change selectors.",
      "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, #nav-global-location-slot a`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 992,
      "position_y": 200,
      "width": 340,
      "height": 151,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (webseite, adresse, schluesselwort, seite, produktname). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 4016,
      "position_y": 500,
      "width": 340,
      "height": 131,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-2",
      "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": 4352,
      "position_y": 500,
      "width": 340,
      "height": 146,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-2"
      }
    },
    {
      "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": 4688,
      "position_y": 500,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-3"
      }
    }
  ]
}