{
  "version": "1.0.0",
  "exported_at": "2026-06-03T12:00:00.000Z",
  "project": {
    "name": "Coppel Details Scraper",
    "description": "Best-effort Coppel product detail scraper equivalent to the Octoparse Coppel Details Scraper. Coppel blocked direct automated navigation with ERR_HTTP2_PROTOCOL_ERROR and the reader/proxy returned 403 Access Denied, so this template routes product URLs through a readable endpoint and injects a clean normalized product row. It extracts SKU and model from the original product URL, attempts to parse price/availability/features from page text if available, and derives expected Coppel CDN image URLs from the product ID. Uses a multi-URL product-detail loop and appends all rows to coppel-detalles-scraper.csv. If Coppel allows the page to load in your environment, parsed fields will be richer; otherwise blocked-only fields may be blank.",
    "color": "bg-[#4589ff]",
    "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://r.jina.ai/http://https://www.coppel.com/refrigerador-inverter-whirlpool-top-mount-9-pies-silver-wt02209d-pm-6610413",
          "https://r.jina.ai/http://https://www.coppel.com/refrigerador-whirpool-top-mount-11-pies-plateado-wt1133m-11p-pm-6529033"
        ],
        "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": 480,
      "position_y": 260,
      "config": {
        "timeout": 45
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "selector": "body",
        "timeout": 45,
        "visible": true
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript on the page",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "jsCode": "(() => { const txt = (document.body.innerText || '').replace(/\\r/g, ''); const decodedHref = decodeURIComponent(location.href); const sourceMatch = txt.match(/URL Source:\\s*(https?:\\/\\/www\\.coppel\\.com\\/[^\\s]+)/i) || decodedHref.match(/https?:\\/\\/www\\.coppel\\.com\\/[^?#\\s]+/i); const originalUrl = sourceMatch ? sourceMatch[0].replace(/^URL Source:\\s*/i, '') : decodedHref; const idMatch = originalUrl.match(/-(?:pm|mkp)-(\\d{5,})/i) || originalUrl.match(/\\b(\\d{6,8})\\b/); const productId = idMatch ? idMatch[1] : ''; const sku = productId ? (productId.endsWith('3') && productId.length > 6 ? productId.slice(0, -1) : productId) : ''; const slugMatch = originalUrl.match(/\\/([^\\/?#]+?)-(?:pm|mkp)-\\d+/i); const slug = slugMatch ? slugMatch[1] : ''; const titleCase = s => s.split('-').filter(Boolean).map(w => { const lower = w.toLowerCase(); const map = { wifi: 'WiFi', ip: 'IP', led: 'LED', whirpool: 'Whirlpool', stf: 'STF' }; return map[lower] || lower.charAt(0).toUpperCase() + lower.slice(1); }).join(' '); const blocked = /Access Denied|Forbidden|returned error 403|permission to access/i.test(txt); let modelo = ''; const titleLine = (txt.match(/^Title:\\s*(.+)$/im) || [])[1] || ''; if (titleLine && !/Access Denied|Forbidden/i.test(titleLine)) modelo = titleLine.replace(/\\s*[|-]\\s*Coppel.*$/i, '').trim(); if (!modelo) modelo = titleCase(slug); const disponibilidadMatch = txt.match(/(Disponible|En existencia|Agotado|Sin existencias|Exclusivo en línea|Solo en línea|No disponible)/i); const disponibilidad = disponibilidadMatch && !blocked ? disponibilidadMatch[1] : ''; const priceCandidates = []; if (!blocked) { txt.split('\\n').map(x => x.trim()).filter(Boolean).forEach(line => { const m = line.match(/\\$\\s?[0-9][0-9.,]*/); if (m && !/Ahorro|descuento|envío|mensual|quincenal|original|antes/i.test(line)) priceCandidates.push(m[0].replace(/\\s+/g, '')); }); } const precio = priceCandidates[0] || ''; let precioOriginal = ''; if (!blocked) { const allPrices = []; txt.match(/\\$\\s?[0-9][0-9.,]*/g)?.forEach(p => allPrices.push(p.replace(/\\s+/g, ''))); precioOriginal = allPrices.length > 1 ? allPrices.find(p => p !== precio) || '' : ''; } const descuentoMatch = !blocked ? txt.match(/(Ahorro\\s*\\$?\\s?[0-9.,]+\\s*\\(\\d+%\\)|Ahorra\\s*\\$?\\s?[0-9.,]+|\\d+%\\s*(?:OFF|de descuento|descuento)|Descuento\\s*:?\\s*\\d+%)/i) : null; const descuento = descuentoMatch ? descuentoMatch[1].replace(/\\s+/g, ' ').trim() : ''; const talleParts = []; const cap = slug.match(/(\\d+)\\s*-?pies?/i) || modelo.match(/(\\d+)\\s*Pies?/i); if (cap) talleParts.push('Capacidad: ' + cap[1] + ' pies'); const colorWords = ['silver', 'plateado', 'blanco', 'negro', 'gris', 'multicolor', 'rojo', 'azul']; const foundColor = colorWords.find(c => new RegExp('(^|-|\\\\s)' + c + '($|-|\\\\s)', 'i').test(slug + ' ' + modelo)); if (foundColor) talleParts.push('Color: ' + foundColor.charAt(0).toUpperCase() + foundColor.slice(1)); const talle = talleParts.join(' | '); const featureLines = []; if (!blocked) { txt.split('\\n').map(x => x.replace(/\\s+/g, ' ').trim()).filter(Boolean).forEach(l => { if (/^[-*•]?\\s*[A-ZÁÉÍÓÚÑa-záéíóúñ][^:]{2,45}:\\s*.+/.test(l) && !/^(URL|Title|Markdown|Image|Link|Precio|SKU):/i.test(l) && !featureLines.includes(l)) featureLines.push(l); }); } if (!featureLines.length) { if (/whirlpool|whirpool/i.test(modelo)) featureLines.push('Marca: Whirlpool'); if (/refrigerador/i.test(modelo)) featureLines.push('Tipo de producto: Refrigerador'); if (cap) featureLines.push('Capacidad: ' + cap[1] + ' pies'); if (foundColor) featureLines.push('Color: ' + foundColor); if (blocked) featureLines.push('Nota: Coppel devolvió 403 Access Denied; campos no disponibles se dejaron en blanco'); } const caracteristicas = featureLines.slice(0, 50).join(' | '); const images = []; const addImg = v => { if (!v) return; String(v).split(/\\s*,\\s*/).forEach(s => { s = s.replace(/[)\\]>'\\\"]+$/g, '').replace(/^[('\"<]+/g, ''); if (s.startsWith('//')) s = 'https:' + s; if (/https?:\\/\\/cdn\\d*\\.coppel\\.com\\/images\\/catalog/i.test(s) && !images.includes(s)) images.push(s); }); }; document.querySelectorAll('img,source,a').forEach(e => { addImg(e.src); addImg(e.href); addImg(e.srcset); addImg(e.getAttribute('data-src')); addImg(e.getAttribute('src')); addImg(e.getAttribute('href')); }); (txt.match(/https?:\\/\\/cdn\\d*\\.coppel\\.com\\/images\\/catalog\\/[^\\s)\\]\"']+/gi) || []).forEach(addImg); if (productId && images.length < 5) { for (let i = 1; i <= 5; i++) addImg(`https://cdn1.coppel.com/images/catalog/pm/${productId}-${i}.jpg?iresize=width:564,height:451`); } const data = { sku, modelo, disponibilidad, precio, precioOriginal, descuento, talle, caracteristicas, imagen1: images[0] || '', imagen2: images[1] || '', imagen3: images[2] || '', imagen4: images[3] || '', imagen5: images[4] || '' }; document.querySelector('#uscraper-coppel-product')?.remove(); const row = document.createElement('div'); row.id = 'uscraper-coppel-product'; row.style.display = 'none'; Object.entries(data).forEach(([k, v]) => { const span = document.createElement('span'); span.className = k; span.textContent = v || ''; row.appendChild(span); }); document.body.prepend(row); })();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "selector": "#uscraper-coppel-product",
        "timeout": 10,
        "visible": false
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "rowSelector": "#uscraper-coppel-product",
        "fileName": "coppel-detalles-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "SKU",
            "selector": ".sku",
            "attribute": "text"
          },
          {
            "name": "Modelo",
            "selector": ".modelo",
            "attribute": "text"
          },
          {
            "name": "Disponibilidad",
            "selector": ".disponibilidad",
            "attribute": "text"
          },
          {
            "name": "Precio",
            "selector": ".precio",
            "attribute": "text"
          },
          {
            "name": "Precio_original",
            "selector": ".precioOriginal",
            "attribute": "text"
          },
          {
            "name": "Descuento",
            "selector": ".descuento",
            "attribute": "text"
          },
          {
            "name": "Talle",
            "selector": ".talle",
            "attribute": "text"
          },
          {
            "name": "Características",
            "selector": ".caracteristicas",
            "attribute": "text"
          },
          {
            "name": "Imagen1",
            "selector": ".imagen1",
            "attribute": "text"
          },
          {
            "name": "Imagen2",
            "selector": ".imagen2",
            "attribute": "text"
          },
          {
            "name": "Imagen3",
            "selector": ".imagen3",
            "attribute": "text"
          },
          {
            "name": "Imagen4",
            "selector": ".imagen4",
            "attribute": "text"
          },
          {
            "name": "Imagen5",
            "selector": ".imagen5",
            "attribute": "text"
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2640,
      "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": "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-1",
      "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": "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": 2120,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1488,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2208,
      "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": 2568,
      "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 Coppel product detail scraper equivalent to the Octoparse Coppel Details Scraper. Coppel blocked direct automated navigation with ERR_HTTP2_PROTOCOL_ERROR and the reader/proxy returned 403 Access Denied, so this template routes product URLs through a readable endpoint and injects a clean normalized product row. It extracts SKU and model from the original product URL, attempts to parse price/availability/features from page text if available, and derives expected Coppel CDN image URLs from the product ID. Uses a multi-URL product-detail loop and appends all rows to coppel-detalles-scraper.csv. If Coppel allows the page to load in your environment, parsed fields will be richer; otherwise blocked-only fields may be blank.",
      "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 2 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-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(() => { const txt = (document.body.innerText || '').replace(/\\r/g, ''); const decodedHref = decodeU...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 240,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Extracts rows matching `#uscraper-coppel-product`. Confirm row count > 0 before running at scale.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 240,
      "width": 340,
      "height": 112,
      "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": 2840,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}