{
  "version": "1.0.0",
  "exported_at": "2026-06-02T12:00:00.000Z",
  "project": {
    "name": "Coto Digital Product Detail Scraper",
    "description": "Scrapes Coto Digital product detail pages by URL. Uses a multi-URL navigate loop with loop-continue to collect all configured product URLs into one CSV. Extracts product URL, product name, PLU, EAN, current price, regular price, description, brand, and image URL. Product detail pages have no listing pagination; navigation is handled by the input URL list. Best effort: Coto Digital may redirect domains or show delayed Angular content/CAPTCHA.",
    "color": "bg-[#e20025]",
    "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": 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.cotodigital3.com.ar/sitios/cdigi/producto/-leche-parcialmente-descremada-2-casanto-1-ltr/_/A-00539120-00539120-200",
          "https://www.cotodigital3.com.ar/sitios/cdigi/producto/-leche-entera-3-casanto-1-ltr/_/A-00539121-00539121-200",
          "https://www.cotodigital3.com.ar/sitios/cdigi/producto/-leche-larga-vida-entera-coto-ttb-1-l/_/A-00008899-00008899-200"
        ],
        "color": "bg-[#08bdba]"
      }
    },
    {
      "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": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "selector": "[data-cnstrc-product-detail]",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "duration": 1,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "rowSelector": "[data-cnstrc-product-detail]",
        "fileName": "coto-digital-detalles-de-productos-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "producto_url",
            "selector": "ROW.ownerDocument.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "producto",
            "selector": "(function(){ return (ROW.getAttribute('data-cnstrc-item-name') || ROW.querySelector('h2.title')?.textContent || '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "plu",
            "selector": "(function(){ const t = (ROW.innerText || ROW.textContent || ''); const m = t.match(/PLU:\\s*([0-9]+)/i); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ean",
            "selector": "(function(){ const t = (ROW.innerText || ROW.textContent || ''); const m = t.match(/EAN:\\s*([0-9]+)/i); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "precio",
            "selector": "var.price",
            "attribute": "text"
          },
          {
            "name": "precio_regular",
            "selector": "(function(){ const t = (ROW.innerText || ROW.textContent || '').replace(/\\s+/g, ' ').trim(); const m = t.match(/Precio\\s+regular\\s*:?\\s*(\\$[0-9.,]+)/i); if (m) return m[1]; return (ROW.querySelector('var.price')?.textContent || '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "descripcion",
            "selector": "(function(){ const t = (ROW.innerText || ROW.textContent || '').replace(/\\s+/g, ' ').trim(); const m = t.match(/Descripción del producto\\s*(.*?)\\s*Características/i); if (m) return m[1].trim(); return (ROW.getAttribute('data-cnstrc-item-name') || ROW.querySelector('h2.title')?.textContent || '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "marca",
            "selector": "(function(){ const t = (ROW.innerText || ROW.textContent || '').replace(/\\s+/g, ' ').trim(); const m = t.match(/MARCA:\\s*(.*?)(?:\\s+SIN TACC:|\\s+[A-ZÁÉÍÓÚÑ ]+:|$)/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "imagen_url",
            "selector": "(function(){ const imgs = Array.from(ROW.querySelectorAll('img')); const img = imgs.find(i => /\\/sitios\\/fotos\\/(large|full|medium|mini)\\//.test(i.src || '')) || imgs.find(i => (i.alt || '').toLowerCase().includes((ROW.getAttribute('data-cnstrc-item-name') || '').toLowerCase().slice(0, 20))); let src = img ? img.src : ''; src = src.replace('/large/', '/full/').replace('/medium/', '/full/').replace('/mini/', '/full/'); return src; })()",
            "attribute": "text",
            "isJs": true
          }
        ],
        "color": "bg-[#42be65]"
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "color": "bg-[#ff832b]"
      }
    }
  ],
  "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-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": "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": 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": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "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": 2208,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Coto Digital product detail pages by URL. Uses a multi-URL navigate loop with loop-continue to collect all configured product URLs into one CSV. Extracts product URL, product name, PLU, EAN, current price, regular price, description, brand, and image URL. Product detail pages have no listing pagination; navigation is handled by the input URL list. Best effort: Coto Digital may redirect domains or show delayed Angular content/CAPTCHA.",
      "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 3 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "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 (producto_url, producto, plu, ean, precio_regular). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 240,
      "width": 340,
      "height": 130,
      "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": 2480,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}