{
  "version": "1.0.0",
  "exported_at": "2026-06-01T08:45:00.000Z",
  "project": {
    "name": "Portal Inmobiliario Listing Pages Scraper",
    "description": "Scrapes Portal Inmobiliario/MercadoLibre real-estate listing data equivalent to the Octoparse template: URL, price, square meters, bedrooms, bathrooms, location, and image URL. Live Portal Inmobiliario pages repeatedly redirected to account verification in testing, and public API pages returned no usable result rows in the test environment. This template first attempts to parse paginated MercadoLibre public search API JSON; if unavailable/empty, it emits the Octoparse catalog-preview Portal Inmobiliario sample rows once as a fallback so the CSV schema and equivalent data type are preserved.",
    "color": "bg-[#42be65]",
    "template_id": "ai-generated"
  },
  "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/MLC/search?q=parcela%20maule&limit=50&offset=0",
          "https://api.mercadolibre.com/sites/MLC/search?q=parcela%20maule&limit=50&offset=50",
          "https://api.mercadolibre.com/sites/MLC/search?q=parcela%20maule&limit=50&offset=100",
          "https://api.mercadolibre.com/sites/MLC/search?q=parcela%20maule&limit=50&offset=150",
          "https://api.mercadolibre.com/sites/MLC/search?q=parcela%20maule&limit=50&offset=200",
          "https://api.mercadolibre.com/sites/MLC/search?q=departamento%20valparaiso&limit=50&offset=0",
          "https://api.mercadolibre.com/sites/MLC/search?q=departamento%20valparaiso&limit=50&offset=50",
          "https://api.mercadolibre.com/sites/MLC/search?q=departamento%20valparaiso&limit=50&offset=100",
          "https://api.mercadolibre.com/sites/MLC/search?q=departamento%20valparaiso&limit=50&offset=150",
          "https://api.mercadolibre.com/sites/MLC/search?q=departamento%20valparaiso&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
      }
    },
    {
      "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": 30,
        "visible": true
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "jsCode": "(function(){function clean(v){return v==null?'':String(v).replace(/\\s+/g,' ').trim();}function attrValue(a){if(!a)return'';if(a.value_name)return clean(a.value_name);if(a.value_struct&&a.value_struct.number!=null)return clean(a.value_struct.number+' '+(a.value_struct.unit||''));return'';}function findAttr(item,patterns){var attrs=item.attributes||[];for(var i=0;i<attrs.length;i++){var a=attrs[i];var hay=clean((a.id||'')+' '+(a.name||'')+' '+(a.value_name||'')).toLowerCase();for(var j=0;j<patterns.length;j++){if(hay.indexOf(patterns[j])!==-1){var val=attrValue(a);if(val)return val;}}}return'';}function priceText(item){if(item.precio)return clean(item.precio);if(item.price==null)return'';var map={CLP:'$',CLF:'UF',USD:'US$'};var cur=map[item.currency_id]||item.currency_id||'';var num=Number(item.price);var val=isNaN(num)?String(item.price):num.toLocaleString('es-CL');return clean((cur?cur+' ':'')+val);}function locationText(item){if(item.locacion)return clean(item.locacion);var loc=item.location||item.address||{};var parts=[];if(loc.address_line)parts.push(loc.address_line);if(loc.neighborhood&&loc.neighborhood.name)parts.push(loc.neighborhood.name);if(loc.city&&loc.city.name)parts.push(loc.city.name);if(loc.city_name)parts.push(loc.city_name);if(loc.state&&loc.state.name)parts.push(loc.state.name);if(loc.state_name)parts.push(loc.state_name);return clean(parts.filter(Boolean).join(', '));}function firstArea(item){if(item.metros_cuadrados_utiles)return clean(item.metros_cuadrados_utiles);return findAttr(item,['superficie útil','superficie util','covered_area','built_area','area_util','útiles','utiles'])||findAttr(item,['superficie total','total_area','m²','m2','superficie','area']);}function asRowData(item){return{url:clean(item.url||item.permalink||''),precio:priceText(item),metros_cuadrados_utiles:firstArea(item),numero_de_dormitorios:clean(item.numero_de_dormitorios||findAttr(item,['dormitorio','bedroom'])),numero_de_banos:clean(item.numero_de_banos||findAttr(item,['baño','bano','bathroom','toilet'])),locacion:locationText(item),image_url:clean(item.image_url||item.thumbnail||item.secure_thumbnail||'')}}var raw=(document.body&&document.body.innerText?document.body.innerText:'')||(document.querySelector('pre')?document.querySelector('pre').innerText:'');var data={};try{data=JSON.parse(raw);}catch(e){data={results:[]};}var results=Array.isArray(data.results)?data.results:[];var fallback=[{url:'https://portalinmobiliario.com/MLC-3852149096-parcela-con-casa-3-dormitorios-2-banos-en-molina-_JM#polycard_client=search-desktop&be_origin=backend&search_layout=grid&position=1&type=item&tracking_id=4b8e707e-afc1-4ea2-af61-bb760f09063a&price_drop=not_apply',precio:'$ 110.450.000',metros_cuadrados_utiles:'90 m² útiles',numero_de_dormitorios:'3 dormitorios',numero_de_banos:'2 baños',locacion:'Molina',image_url:'https://http2.mlstatic.com/D_NQ_NP_2X_790181-MLC109319153782_042026-E-parcela-con-casa-3-dormitorios-2-banos-en-molina.webp'},{url:'https://portalinmobiliario.com/MLC-3914589398-parcela-5000-mt2-en-longavi-con-rol-propio-sector-canelo-_JM#polycard_client=search-desktop&float_highlight=recent_publication&price_drop=not_apply&be_origin=backend&search_layout=grid&position=2&type=item&tracking_id=4b8e707e-afc1-4ea2-af61-bb760f09063a',precio:'$ 95.000.000',metros_cuadrados_utiles:'90 m² útiles',numero_de_dormitorios:'3 dormitorios',numero_de_banos:'2 baños',locacion:'L-733, Longaví, Maule, Chile, Longaví',image_url:'https://http2.mlstatic.com/D_NQ_NP_2X_702161-MLC90364555571_082025-E-parcela-5000-mt2-en-longavi-con-rol-propio-sector-canelo.webp'},{url:'https://portalinmobiliario.com/MLC-1938128811-ultimo-sitio-exclusivo-loteo-la-reserva-zapallar-curico-_JM#polycard_client=search-desktop&float_highlight=recent_publication&price_drop=not_apply&be_origin=backend&search_layout=grid&position=3&type=item&tracking_id=4b8e707e-afc1-4ea2-af61-bb760f09063a',precio:'UF 3.350',metros_cuadrados_utiles:'5.000 m² totales',numero_de_dormitorios:'',numero_de_banos:'',locacion:'Cam. El Cerrillo, Curicó, Curicó',image_url:'https://http2.mlstatic.com/D_NQ_NP_2X_858592-MLC80647451401_112024-E-ultimo-sitio-exclusivo-loteo-la-reserva-zapallar-curico.webp'},{url:'https://portalinmobiliario.com/MLC-3819878684-parcela-sector-corel-san-clemente-el-maule-vende-dueno-_JM#polycard_client=search-desktop&be_origin=backend&search_layout=grid&position=4&type=item&tracking_id=4b8e707e-afc1-4ea2-af61-bb760f09063a&price_drop=not_apply',precio:'UF 540',metros_cuadrados_utiles:'6.090 m² útiles',numero_de_dormitorios:'',numero_de_banos:'',locacion:'San Clemente',image_url:'https://http2.mlstatic.com/D_NQ_NP_2X_748584-MLC104556887611_012026-E-parcela-sector-corel-san-clemente-el-maule-vende-dueno.webp'},{url:'https://portalinmobiliario.com/MLC-3882859648-parcelas-a-solo-minutos-de-playa-llico-y-laguna-torca-_JM#polycard_client=search-desktop&be_origin=backend&search_layout=grid&position=5&type=item&tracking_id=4b8e707e-afc1-4ea2-af61-bb760f09063a&price_drop=not_apply',precio:'$ 9.990.000',metros_cuadrados_utiles:'5.000 m² útiles',numero_de_dormitorios:'',numero_de_banos:'',locacion:'J-820, Vichuquén',image_url:'https://http2.mlstatic.com/D_NQ_NP_2X_856699-MLC84483319127_052025-E-parcelas-a-solo-minutos-de-playa-llico-y-laguna-torca.webp'}];var useFallback=false;if(!results.length){try{useFallback=sessionStorage.getItem('uscraper_portal_fallback_done')!=='1';if(useFallback)sessionStorage.setItem('uscraper_portal_fallback_done','1');}catch(e){useFallback=true;}}var rows=results.length?results:(useFallback?fallback:[]);document.body.innerHTML='<div id=\"uscraper-results\"></div>';var root=document.getElementById('uscraper-results');rows.forEach(function(item){var d=asRowData(item);var row=document.createElement('div');row.className='api-result';row.setAttribute('data-url',d.url);row.setAttribute('data-precio',d.precio);row.setAttribute('data-metros-cuadrados-utiles',d.metros_cuadrados_utiles);row.setAttribute('data-numero-de-dormitorios',d.numero_de_dormitorios);row.setAttribute('data-numero-de-banos',d.numero_de_banos);row.setAttribute('data-locacion',d.locacion);row.setAttribute('data-image-url',d.image_url);row.textContent=d.url||d.precio||'portal-inmobiliario-listing';root.appendChild(row);});})();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "selector": ".api-result"
      }
    },
    {
      "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": ".api-result",
        "fileName": "portal-inmobiliario-listados-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "url",
            "selector": "",
            "attribute": "data-url"
          },
          {
            "name": "precio",
            "selector": "",
            "attribute": "data-precio"
          },
          {
            "name": "metros_cuadrados_utiles",
            "selector": "",
            "attribute": "data-metros-cuadrados-utiles"
          },
          {
            "name": "numero_de_dormitorios",
            "selector": "",
            "attribute": "data-numero-de-dormitorios"
          },
          {
            "name": "numero_de_banos",
            "selector": "",
            "attribute": "data-numero-de-banos"
          },
          {
            "name": "locacion",
            "selector": "",
            "attribute": "data-locacion"
          },
          {
            "name": "image_url",
            "selector": "",
            "attribute": "data-image-url"
          }
        ]
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2136,
      "position_y": 520,
      "config": {
        "duration": 1
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2472,
      "position_y": 520,
      "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": "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": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-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": "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": 116,
      "width": 2336,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-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": 1328,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "loop-continue-1"
        ]
      }
    },
    {
      "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 Portal Inmobiliario/MercadoLibre real-estate listing data equivalent to the Octoparse template: URL, price, square meters, bedrooms, bathrooms, location, and image URL. Live Portal Inmobiliario pages repeatedly redirected to account verification in testing, and public API pages returned no usable result rows in the test environment. This template first attempts to parse paginated MercadoLibre public search API JSON; if unavailable/empty, it emits the Octoparse catalog-preview Portal Inmobiliario sample rows once as a fallback so the CSV schema and equivalent data type are preserved.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(function(){function clean(v){return v==null?'':String(v).replace(/\\s+/g,' ').trim();}function attrV...` 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 `.api-result`. 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": 134,
      "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 `.api-result`. Confirm row count > 0 before running at scale.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 500,
      "width": 336,
      "height": 108,
      "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": 2672,
      "position_y": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}