{
  "version": "1.0.0",
  "exported_at": "2026-06-01T15:35:00.000Z",
  "project": {
    "name": "Carrefour Spain Listing Scraper",
    "description": "Best-effort equivalent of the Octoparse Carrefour Spain Listing Scraper. Carrefour listing/search/category pages did not render product rows in autonomous tests, so this template uses a multi-URL navigation loop over Carrefour product detail URLs from the Octoparse preview and extracts the same fields: Cantidad_Resultado, Nombre, Precio, Unidad, Promoción, and URL. Output is appended to one CSV. Carrefour may show Cloudflare/security verification or CAPTCHA; if blocked, solve it manually in the browser profile before continuing.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser viewport size",
      "position_x": 120,
      "position_y": 220,
      "config": {
        "width": 1920,
        "height": 1080
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 480,
      "position_y": 220,
      "config": {
        "urls": [
          "https://www.carrefour.es/supermercado/bolitas-tres-chocolates-carrefour-sensation-choco-ballz-sin-gluten-doy-pack-200-g/R-VC4AECOMM-314570/p",
          "https://www.carrefour.es/supermercado/chocolate-con-leche-relleno-de-cremoso-con-galleta-nestle-extrafino-tostarica-84-g/R-VC4AECOMM-254878/p",
          "https://www.carrefour.es/supermercado/chocolate-con-leche-relleno-de-triple-caramelo-milka-90-g/R-852900586/p",
          "https://www.carrefour.es/supermercado/barritas-de-galleta-y-chocolate-nestle-extrafino-pack-de-6-unidades-de-18-g/R-VC4AECOMM-444651/p",
          "https://www.carrefour.es/supermercado/chocolate-con-leche-nestle-extrafino-sin-gluten-150-g/R-VC4AECOMM-463050/p",
          "https://www.carrefour.es/supermercado/chocolate-con-leche-milka-270-g/R-521004223/p",
          "https://www.carrefour.es/supermercado/chocolate-con-leche-relleno-de-galleta-leche-y-chocolate-milka-300-g/R-521004407/p"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "carrefour",
          "supermercado",
          "chocolate",
          "product-detail-urls"
        ]
      }
    },
    {
      "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": 220,
      "config": {
        "timeout": 45
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "duration": 4
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "selector": "#onetrust-accept-btn-handler"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "selector": "#onetrust-accept-btn-handler",
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2280,
      "position_y": 220,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 2640,
      "position_y": 560,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 3000,
      "position_y": 560,
      "config": {
        "rowSelector": "body",
        "fileName": "carrefour-listados-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "cantidad_resultado",
            "selector": "(() => { const blocked = /Performing security verification|not a bot|Cloudflare|Enable JavaScript and cookies/i.test(document.body.innerText || ''); if (blocked) return 'BLOQUEADO - verificación de seguridad'; const candidates = ['[data-testid=\"search-results-count\"]', '.search-results__count', '.plp-header__total', '.product-list__total', '.results-number', '[class*=\"result\"][class*=\"count\"]']; for (const s of candidates) { const el = document.querySelector(s); if (el && el.textContent && el.textContent.trim()) return el.textContent.replace(/\\s+/g, ' ').trim(); } return 'Producto individual desde URL de entrada'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "nombre",
            "selector": "(() => { const blocked = /Performing security verification|not a bot|Cloudflare|Enable JavaScript and cookies/i.test(document.body.innerText || ''); if (blocked) return ''; const el = document.querySelector('h1.product-header__name, .product-header__name, h1'); return el ? (el.textContent || '').replace(/\\s+/g, ' ').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "precio",
            "selector": "(() => { const blocked = /Performing security verification|not a bot|Cloudflare|Enable JavaScript and cookies/i.test(document.body.innerText || ''); if (blocked) return ''; const selectors = ['.buybox__price', '.product-price__price', '[class*=\"buybox\"][class*=\"price\"]', '[class*=\"price\"]']; const clean = e => (e.textContent || '').replace(/\\s+/g, ' ').trim(); for (const s of selectors) { const els = Array.from(document.querySelectorAll(s)); const el = els.find(e => /€/.test(clean(e)) && !/(\\/|kg|kilo|litro|l\\b|unidad|ud\\b)/i.test(clean(e))) || els.find(e => /€/.test(clean(e))); if (el) return clean(el); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "unidad",
            "selector": "(() => { const blocked = /Performing security verification|not a bot|Cloudflare|Enable JavaScript and cookies/i.test(document.body.innerText || ''); if (blocked) return ''; const selectors = ['.buybox__price-per-unit', '.price-per-unit', '[class*=\"price-per-unit\"]', '[class*=\"unit-price\"]', '[class*=\"price\"]']; const clean = e => (e.textContent || '').replace(/\\s+/g, ' ').trim(); for (const s of selectors) { const el = Array.from(document.querySelectorAll(s)).find(e => /€\\s*\\//.test(clean(e)) || /€.*(kg|kilo|l\\b|litro|unidad|ud\\b)/i.test(clean(e))); if (el) return clean(el); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "promocion",
            "selector": "(() => { const blocked = /Performing security verification|not a bot|Cloudflare|Enable JavaScript and cookies/i.test(document.body.innerText || ''); if (blocked) return ''; const selectors = ['.badge__name', '.buybox__badge-promotions .badge__name', '.pdp-badge .badge__name', '[class*=\"promo\"]', '[class*=\"badge\"]', '[class*=\"offer\"]']; for (const s of selectors) { const el = Array.from(document.querySelectorAll(s)).find(e => (e.textContent || '').replace(/\\s+/g, ' ').trim()); if (el) return (el.textContent || '').replace(/\\s+/g, ' ').trim(); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url",
            "selector": "(() => location.href)",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 3360,
      "position_y": 560,
      "config": {}
    }
  ],
  "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": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-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-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-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": "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": 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": 408,
      "position_y": 116,
      "width": 2480,
      "height": 636,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "sleep-2",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1488,
      "position_y": 116,
      "width": 2120,
      "height": 636,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2928,
      "position_y": 456,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort equivalent of the Octoparse Carrefour Spain Listing Scraper. Carrefour listing/search/category pages did not render product rows in autonomous tests, so this template uses a multi-URL navigation loop over Carrefour product detail URLs from the Octoparse preview and extracts the same fields: Cantidad_Resultado, Nombre, Precio, Unidad, Promoción, and URL. Output is appended to one CSV. Carrefour may show Cloudflare/security verification or CAPTCHA; if blocked, solve it manually in the browser profile before continuing.",
      "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": 680,
      "position_y": 200,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `#onetrust-accept-btn-handler`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 200,
      "width": 340,
      "height": 139,
      "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 (cantidad_resultado, nombre, precio, unidad, promocion). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 3200,
      "position_y": 540,
      "width": 340,
      "height": 131,
      "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": 3560,
      "position_y": 540,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}