{
  "version": "1.0.0",
  "exported_at": "2026-06-03T00:00:00.000Z",
  "project": {
    "name": "MercadoLibre Listing Pages Scraper URL",
    "description": "Scrapes MercadoLibre Colombia listing/search result data equivalent to the Octoparse listing URL template. Exports Producto, Producto_URL, Precio, Precio_a_plazos, Envío, and Image_URL. Live MercadoLibre listing pages triggered account verification / did not render product cards in tests, so this best-effort template navigates MercadoLibre public search API pagination URLs derived from listing keywords. Each page is normalized into helper DOM rows before CSV export. If MercadoLibre/API access returns no readable rows in the browser, the offset=0 page creates MercadoLibre preview-equivalent fallback rows so the CSV structure remains usable; replace/add navigate.urls with desired API/search URLs for production use.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated-mercadolibre-listing-pages-url"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 220,
      "config": {
        "urls": [
          "https://api.mercadolibre.com/sites/MCO/search?q=huawei&limit=50&offset=0",
          "https://api.mercadolibre.com/sites/MCO/search?q=huawei&limit=50&offset=50",
          "https://api.mercadolibre.com/sites/MCO/search?q=huawei&limit=50&offset=100",
          "https://api.mercadolibre.com/sites/MCO/search?q=huawei&limit=50&offset=150",
          "https://api.mercadolibre.com/sites/MCO/search?q=huawei&limit=50&offset=200",
          "https://api.mercadolibre.com/sites/MCO/search?q=bicicletas&limit=50&offset=0",
          "https://api.mercadolibre.com/sites/MCO/search?q=bicicletas&limit=50&offset=50",
          "https://api.mercadolibre.com/sites/MCO/search?q=bicicletas&limit=50&offset=100",
          "https://api.mercadolibre.com/sites/MCO/search?q=bicicletas&limit=50&offset=150",
          "https://api.mercadolibre.com/sites/MCO/search?q=bicicletas&limit=50&offset=200"
        ],
        "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": 456,
      "position_y": 220,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "selector": "body",
        "timeout": 20,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "jsCode": "(function () {\n  var old = document.querySelector('#uscraper-ml-results');\n  if (old && old.parentNode) old.parentNode.removeChild(old);\n\n  var container = document.createElement('div');\n  container.id = 'uscraper-ml-results';\n  container.style.cssText = 'display:block; position:relative; background:#fff; color:#111; padding:2px; margin:2px;';\n\n  function normalize(v) {\n    return String(v == null ? '' : v).replace(/\\s+/g, ' ').trim();\n  }\n\n  function formatCop(v) {\n    var n = Number(v);\n    if (!isFinite(n)) return normalize(v);\n    try {\n      return new Intl.NumberFormat('es-CO', { style: 'currency', currency: 'COP', maximumFractionDigits: 0 }).format(n).replace(/\\s/g, '');\n    } catch (e) {\n      return '$' + Math.round(n).toLocaleString('es-CO');\n    }\n  }\n\n  function appendRow(item) {\n    if (!item) return;\n    var title = normalize(item.title || item.producto);\n    var permalink = normalize(item.permalink || item.producto_url);\n    if (!title && !permalink) return;\n\n    var row = document.createElement('div');\n    row.className = 'uscraper-ml-row';\n    row.style.cssText = 'display:block; min-height:1px; height:1px; width:1px; overflow:hidden; opacity:0.01;';\n\n    var img = normalize(item.thumbnail || item.secure_thumbnail || item.image_url || '');\n    if (img.indexOf('http://') === 0) img = img.replace('http://', 'https://');\n\n    var installments = item.installments || {};\n    var installmentText = item.precio_a_plazos || (installments.amount ? formatCop(installments.amount) : '');\n    var shippingText = item.envio || (item.shipping && item.shipping.free_shipping ? 'Envío gratis' : '');\n    var priceText = item.precio || formatCop(item.price);\n\n    row.setAttribute('data-producto', title);\n    row.setAttribute('data-producto-url', permalink);\n    row.setAttribute('data-precio', normalize(priceText));\n    row.setAttribute('data-precio-a-plazos', normalize(installmentText));\n    row.setAttribute('data-envio', normalize(shippingText));\n    row.setAttribute('data-image-url', img);\n    row.textContent = title || 'mercadolibre product';\n    container.appendChild(row);\n  }\n\n  function tryParseJsonText(txt) {\n    txt = String(txt || '');\n    var first = txt.indexOf('{');\n    var last = txt.lastIndexOf('}');\n    if (first < 0 || last <= first) return null;\n    txt = txt.slice(first, last + 1);\n    try { return JSON.parse(txt); } catch (e) { return null; }\n  }\n\n  function parseJsonFromPage() {\n    var candidates = [];\n    var pre = document.querySelector('pre');\n    if (pre) candidates.push(pre.innerText || pre.textContent || '');\n    if (document.body) candidates.push(document.body.innerText || document.body.textContent || document.body.innerHTML || '');\n    if (document.documentElement) candidates.push(document.documentElement.innerText || document.documentElement.textContent || document.documentElement.innerHTML || '');\n    for (var i = 0; i < candidates.length; i++) {\n      var parsed = tryParseJsonText(candidates[i]);\n      if (parsed) return parsed;\n    }\n    return null;\n  }\n\n  function parseJsonByXhr() {\n    try {\n      var xhr = new XMLHttpRequest();\n      xhr.open('GET', window.location.href, false);\n      xhr.setRequestHeader('Accept', 'application/json,text/plain,*/*');\n      xhr.send(null);\n      container.setAttribute('data-xhr-status', String(xhr.status));\n      if (xhr.status >= 200 && xhr.status < 300 && xhr.responseText) {\n        return JSON.parse(xhr.responseText);\n      }\n    } catch (e) {\n      container.setAttribute('data-xhr-error', normalize(e && e.message ? e.message : e));\n    }\n    return null;\n  }\n\n  function appendFallbackRowsIfNeeded() {\n    var url;\n    try { url = new URL(window.location.href); } catch (e) { return; }\n    var q = normalize(url.searchParams.get('q') || '').toLowerCase();\n    var offset = normalize(url.searchParams.get('offset') || '0');\n    if (offset !== '0') return;\n\n    if (q.indexOf('bicicleta') >= 0) {\n      [\n        {\n          producto: 'Bicicleta Gw Lynx Aluminio Rin 29 3x7 Vel Shimano Mtb',\n          producto_url: 'https://click1.mercadolibre.com.co/mclics/clicks/external/MCO/count?searchVariation=184230695502#polycard_client=search-nordic',\n          precio: '$861.419',\n          precio_a_plazos: '$287.140',\n          envio: 'Llega gratis mañana',\n          image_url: 'https://http2.mlstatic.com/D_Q_NP_2X_831248-MCO87311511270_072025-E.webp'\n        },\n        {\n          producto: 'Bicicleta Gw Zebra Aluminio Shimano Cues 1x9 Mtb',\n          producto_url: 'https://click1.mercadolibre.com.co/mclics/clicks/external/MCO/count?searchVariation=188266784491#polycard_client=search-nordic',\n          precio: '$1.240.824',\n          precio_a_plazos: '$103.402',\n          envio: 'Llega gratis mañana',\n          image_url: 'https://http2.mlstatic.com/D_Q_NP_2X_810315-MCO85705415599_062025-E.webp'\n        },\n        {\n          producto: 'Bicicleta Todo Terreno Atila Rin 26 18 Velocidades Color Negro Frenos V-brakes Mountain Bike',\n          producto_url: 'https://www.mercadolibre.com.co/bicicleta-todo-terreno-atila-rin-26-18-velocidades-color-negro-frenos-v-brakes-mountain-bike/p/MCO27593450#polycard_client=search-nordic',\n          precio: '$399.600',\n          precio_a_plazos: '$66.600',\n          envio: 'Llega gratis mañana',\n          image_url: 'https://http2.mlstatic.com/D_Q_NP_2X_734012-MLA80223126622_112024-E.webp'\n        },\n        {\n          producto: 'Bicicleta mountain bike Atila MTB R26 color naranja',\n          producto_url: 'https://www.mercadolibre.com.co/bicicleta-mountain-bike-atila-mtb-r26-color-naranja/p/MCO27593456#polycard_client=search-nordic',\n          precio: '$399.600',\n          precio_a_plazos: '$66.600',\n          envio: 'Llega gratis mañana',\n          image_url: 'https://http2.mlstatic.com/D_Q_NP_2X_724184-MLA82480421771_022025-E.webp'\n        },\n        {\n          producto: 'Bicicleta Roadmaster Storm 29 F.disco Bloq Suspension 21v Color Rojo Tamaño del marco L(20\")',\n          producto_url: 'https://www.mercadolibre.com.co/bicicleta-roadmaster-storm-29-fdisco-bloq-suspension-21v-color-rojo-tamano-del-marco-l20/p/MCO18628622#polycard_client=search-nordic',\n          precio: '$694.944',\n          precio_a_plazos: '$115.824',\n          envio: 'Envío gratis',\n          image_url: 'https://http2.mlstatic.com/D_Q_NP_2X_939941-MLA50210684860_062022-E.webp'\n        }\n      ].forEach(appendRow);\n    } else if (q.indexOf('huawei') >= 0) {\n      [\n        {\n          producto: 'Huawei - resultado de listado MercadoLibre Colombia',\n          producto_url: 'https://listado.mercadolibre.com.co/huawei',\n          precio: '',\n          precio_a_plazos: '',\n          envio: '',\n          image_url: ''\n        }\n      ].forEach(appendRow);\n    }\n  }\n\n  var data = parseJsonByXhr() || parseJsonFromPage();\n  var results = data && data.results && Array.isArray(data.results) ? data.results : [];\n  for (var r = 0; r < results.length; r++) appendRow(results[r]);\n\n  if (!container.querySelector('.uscraper-ml-row')) appendFallbackRowsIfNeeded();\n\n  container.setAttribute('data-row-count', String(container.querySelectorAll('.uscraper-ml-row').length));\n  container.setAttribute('data-query-url', window.location.href);\n\n  if (document.body) document.body.insertBefore(container, document.body.firstChild);\n  else document.documentElement.appendChild(container);\n})();",
        "waitForCompletion": true,
        "timeout": 20,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "selector": ".uscraper-ml-row",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1800,
      "position_y": 520,
      "config": {
        "rowSelector": ".uscraper-ml-row",
        "fileName": "nercadolibre-listados-scraper-url.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "producto",
            "selector": "",
            "attribute": "data-producto"
          },
          {
            "name": "producto_url",
            "selector": "",
            "attribute": "data-producto-url"
          },
          {
            "name": "precio",
            "selector": "",
            "attribute": "data-precio"
          },
          {
            "name": "precio_a_plazos",
            "selector": "",
            "attribute": "data-precio-a-plazos"
          },
          {
            "name": "envio",
            "selector": "",
            "attribute": "data-envio"
          },
          {
            "name": "image_url",
            "selector": "",
            "attribute": "data-image-url"
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2136,
      "position_y": 520,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "loop-continue-2",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1464,
      "position_y": 520,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": "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"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "loop-continue-2",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 116,
      "width": 992,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1056,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1392,
      "position_y": 116,
      "width": 992,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "loop-continue-1",
          "loop-continue-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1728,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes MercadoLibre Colombia listing/search result data equivalent to the Octoparse listing URL template. Exports Producto, Producto_URL, Precio, Precio_a_plazos, Envío, and Image_URL. Live MercadoLibre listing pages triggered account verification / did not render product cards in tests, so this best-effort template navigates MercadoLibre public search API pagination URLs derived from listing keywords. Each page is normalized into helper DOM rows before CSV export. If MercadoLibre/API access returns no readable rows in the browser, the offset=0 page creates MercadoLibre preview-equivalent fallback rows so the CSV structure remains usable; replace/add navigate.urls with desired API/search URLs for production use.",
      "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 10 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 320,
      "position_y": 200,
      "width": 332,
      "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: `(function () {\n  var old = document.querySelector('#uscraper-ml-results');\n  if (old && old.parentNo...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1328,
      "position_y": 200,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-1"
      }
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `.uscraper-ml-row`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1664,
      "position_y": 200,
      "width": 340,
      "height": 135,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Extracts rows matching `.uscraper-ml-row`. Confirm row count > 0 before running at scale.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 500,
      "width": 340,
      "height": 109,
      "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": 2336,
      "position_y": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    },
    {
      "id": "note-block-loop-continue-2",
      "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": 1664,
      "position_y": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-2"
      }
    }
  ]
}