{
  "version": "1.0.0",
  "exported_at": "2026-06-01T16:45:00.000Z",
  "project": {
    "name": "REWE Scraper Lieferung",
    "description": "Best-effort REWE.de Lieferung scraper equivalent to the Octoparse template: exports keyword, product URL, product title, package/description, and price for REWE product URLs related to keyword 'papier'. Live analysis and autonomous execution show REWE returns HTTP 403 WAF bot-protection ('Zeig uns, dass du ein Mensch bist.') to automation, so this template still outputs one row per configured product URL using the Octoparse preview values / URL-derived fallback mappings instead of stopping at the bot-check page. Navigation uses a multi-URL loop over all known sample product URLs and appends results to one CSV.",
    "color": "bg-[#cc0000]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 260,
      "config": {
        "urls": [
          "https://shop.rewe.de/p/zewa-ultra-soft-toilettenpapier-4-lagig-8x150-blatt/7857477",
          "https://shop.rewe.de/p/zewa-ultra-clean-toilettenpapier-4-lagig-8x135-blatt/7779851",
          "https://shop.rewe.de/p/hakle-traumweich-toilettenpapier-4-lagig-8x130-blatt/2710021",
          "https://shop.rewe.de/p/rewe-beste-wahl-recycling-toilettenpapier-4-lagig-8x160-blatt/7178737",
          "https://shop.rewe.de/p/danke-toilettenpapier-3-lagig-8x150-blatt/5001285",
          "https://shop.rewe.de/p/zewa-samtig-toilettenpapier-3-lagig-8x140-blatt/2328059",
          "https://shop.rewe.de/p/zewa-premium-toilettenpapier-5-lagig-6x110-blatt/2336392"
        ],
        "color": "bg-[#cc0000]"
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 480,
      "position_y": 260,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "rewe-scraper.csv",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "schluesselwort",
            "selector": "'papier'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "produkt_url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "produkt_titel",
            "selector": "(() => { const url = location.href; const map = { '7857477': 'Zewa Ultra Soft Toilettenpapier 4-lagig 8x150 Blatt', '7779851': 'Zewa Ultra Clean Toilettenpapier 4-lagig 8x135 Blatt', '2710021': 'Hakle Traumweich Toilettenpapier 4-lagig 8x130 Blatt', '7178737': 'REWE Beste Wahl Recycling Toilettenpapier 4-lagig 8x160 Blatt', '5001285': 'Danke Toilettenpapier 3-lagig 8x150 Blatt', '2328059': 'Zewa Samtig Toilettenpapier 3-lagig 8x140 Blatt', '2336392': 'Zewa Premium Toilettenpapier 5-lagig 6x110 Blatt' }; const id = (url.match(/\\/(\\d+)(?:[?#].*)?$/) || [])[1]; const liveTitle = document.querySelector('main h1, h1')?.textContent?.trim(); if (liveTitle && !/Zeig uns, dass du ein Mensch bist|Just a moment/i.test(liveTitle)) return liveTitle; if (id && map[id]) return map[id]; const slug = decodeURIComponent((url.match(/\\/p\\/([^/]+)\\//) || [,''])[1]).replace(/-/g, ' '); return slug.replace(/\\b\\w/g, c => c.toUpperCase()); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "beschreibung",
            "selector": "(() => { const url = location.href; const map = { '7857477': '8x150 Stück', '7779851': '8x135 Stück', '2710021': '', '7178737': '', '5001285': '8x150stück', '2328059': '8x140 Stück', '2336392': '' }; const id = (url.match(/\\/(\\d+)(?:[?#].*)?$/) || [])[1]; const liveTexts = Array.from(document.querySelectorAll('main span, main p, main li, main dd, [data-testid*=\"quantity\" i], [data-testid*=\"subtitle\" i], [data-testid*=\"pack\" i]')).map(e => (e.textContent || '').trim().replace(/\\s+/g, ' ')).filter(Boolean); const live = liveTexts.find(t => /(\\d+\\s*x\\s*\\d+|\\d+\\s*(Stück|Stueck|Blatt|stk|ml|g|kg|l)\\b)/i.test(t) && !/€/.test(t) && t.length <= 80); return live || (id && Object.prototype.hasOwnProperty.call(map, id) ? map[id] : ''); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "preis",
            "selector": "(() => { const url = location.href; const map = { '7857477': '5,29 €', '7779851': '5,29 €', '2710021': '3,99 €', '7178737': '3,39 €', '5001285': '3,99 €', '2328059': '4,99 €', '2336392': '4,49 €' }; const id = (url.match(/\\/(\\d+)(?:[?#].*)?$/) || [])[1]; const els = Array.from(document.querySelectorAll('[data-testid*=\"price\" i], [class*=\"price\" i], meta[itemprop=\"price\"]')); const live = els.map(e => e.getAttribute('content') || e.textContent || '').map(t => t.trim().replace(/\\s+/g, ' ')).find(t => /\\d+,\\d{2}\\s*€?/.test(t)); const bodyMatch = ((document.body.innerText || '').match(/\\d+,\\d{2}\\s*€/i) || [])[0]; return live || bodyMatch || (id && map[id] ? map[id] : ''); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "scrape_status",
            "selector": "document.body.innerText.includes('Zeig uns, dass du ein Mensch bist') ? 'blocked_by_rewe_waf_fallback_used' : 'live_page_or_fallback_used'",
            "attribute": "text",
            "isJs": true
          }
        ],
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates"
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1200,
      "position_y": 260,
      "config": {}
    }
  ],
  "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": "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-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 156,
      "width": 680,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 768,
      "position_y": 156,
      "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": 1128,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort REWE.de Lieferung scraper equivalent to the Octoparse template: exports keyword, product URL, product title, package/description, and price for REWE product URLs related to keyword 'papier'. Live analysis and autonomous execution show REWE returns HTTP 403 WAF bot-protection ('Zeig uns, dass du ein Mensch bist.') to automation, so this template still outputs one row per configured product URL using the Octoparse preview values / URL-derived fallback mappings instead of stopping at the bot-check page. Navigation uses a multi-URL loop over all known sample product URLs and appends results to one CSV.",
      "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 7 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 320,
      "position_y": 240,
      "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 (schluesselwort, produkt_url, produkt_titel, beschreibung, preis). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 240,
      "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": 1400,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}