{
  "version": "1.0.0",
  "exported_at": "2026-06-02T00:55:00.000Z",
  "project": {
    "name": "FincaraÃz Post Details Scraper",
    "description": "Scrapes Fincaraíz project/property detail pages by URL and exports property name, URL, location, image URL, description, stratum, status, total area, private area, bedrooms, bathrooms, and price. Uses a multi-URL navigate loop; add more Fincaraíz detail-page URLs to the navigate.urls array to process more inputs. Individual detail pages have no pagination, but each row in the project 'Tipos' table is exported as a separate CSV row.",
    "color": "bg-[#4589ff]",
    "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": 240,
      "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": 240,
      "config": {
        "urls": [
          "https://www.fincaraiz.com.co/proyectos-vivienda/ejereal-apartamentos-en-venta-en-avenida-centenario-armenia/10118042",
          "https://www.fincaraiz.com.co/proyectos-vivienda/l-unique-apartamentos-apartamentos-en-venta-en-riomar-barranquilla/10054988"
        ],
        "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": 840,
      "position_y": 240,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "jsCode": "(() => { const roots = Array.from(document.querySelectorAll('[id*=\"cookie\" i], [class*=\"cookie\" i], [aria-label*=\"cookie\" i]')); for (const root of roots) { const btn = Array.from(root.querySelectorAll('button,a')).find(el => /acept|accept|agree|cerrar|close/i.test((el.textContent || '').trim())); if (btn) { btn.click(); return 'cookie button clicked'; } } return 'no cookie banner action'; })();",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "selector": "table tbody tr",
        "timeout": 30,
        "visible": true,
        "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": 240,
      "config": {
        "rowSelector": "table tbody tr",
        "fileName": "fincaraiz-detalles-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "vivienda",
            "selector": "(() => { const h = document.querySelector('h1'); const text = h ? h.textContent.trim() : ''; return text ? text.split(',')[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "vivienda_url",
            "selector": "(() => window.location.href)()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ubicacion",
            "selector": "(() => { const labels = Array.from(document.querySelectorAll('p,b,span')); const label = labels.find(e => (e.textContent || '').trim() === 'Ubicación Principal'); let value = ''; if (label) { const ps = Array.from(label.parentElement ? label.parentElement.querySelectorAll('p') : []); const idx = ps.indexOf(label); const next = idx >= 0 ? ps[idx + 1] : null; value = (next || label.nextElementSibling || {}).textContent || ''; } if (!value) { const text = document.body.innerText || ''; const m = text.match(/Ubicación Principal\\s+([^\\n]+?)(?:\\n|Ubicaciones asociadas)/i); value = m ? m[1] : ''; } return value.trim().replace(/,\\s*/g, ' - '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "imagen_url",
            "selector": "(() => { const img = document.querySelector('.property-cover-gallery img[src*=\"/photos/\"], img[src*=\"/photos/\"]'); const meta = document.querySelector('meta[property=\"og:image\"]'); let src = (img && img.src) || (meta && meta.content) || ''; return src.replace(/\\/resizedImages\\/[^/]+\\//, '/resizedImages/original/').replace(/#.*$/, ''); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "descripcion",
            "selector": "(() => { const text = (document.body.innerText || '').replace(/\\r/g, ''); const m = text.match(/Descripción\\s+([\\s\\S]*?)\\s+Código Fincaraíz:/i); return m ? m[1].replace(/\\s+/g, ' ').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "estrato",
            "selector": "(() => { const lines = (document.body.innerText || '').split(/\\n+/).map(s => s.trim()).filter(Boolean); const i = lines.findIndex(l => l === 'Estrato'); if (i >= 0 && lines[i + 1]) return lines[i + 1].replace(/^ⓘ.*/, '').trim(); const text = document.body.innerText || ''; const m = text.match(/Estrato\\s+([^\\n]+?)(?:\\s+ⓘ|\\s+Características|\\n)/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "estado",
            "selector": "(() => { const lines = (document.body.innerText || '').split(/\\n+/).map(s => s.trim()).filter(Boolean); const i = lines.findIndex(l => l === 'Estado'); if (i >= 0 && lines[i + 1]) return lines[i + 1].trim(); const text = document.body.innerText || ''; const m = text.match(/Estado\\s+([^\\n]+?)(?:\\s+Parqueaderos|\\s+Financiación|\\n)/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "area_total",
            "selector": "td:nth-child(1)",
            "attribute": "text"
          },
          {
            "name": "area_privada",
            "selector": "td:nth-child(2)",
            "attribute": "text"
          },
          {
            "name": "habitaciones",
            "selector": "(() => { const text = (ROW.querySelector('td:nth-child(4)') || {}).innerText || ''; const m = text.match(/\\d+/); return m ? m[0] : text.trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "banos",
            "selector": "(() => { const text = (ROW.querySelector('td:nth-child(5)') || {}).innerText || ''; const m = text.match(/\\d+/); return m ? m[0] : text.trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "precio",
            "selector": "td:nth-child(6)",
            "attribute": "text"
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": "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": 136,
      "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": 136,
      "width": 1400,
      "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": 1128,
      "position_y": 136,
      "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": 1848,
      "position_y": 136,
      "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": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Fincaraíz project/property detail pages by URL and exports property name, URL, location, image URL, description, stratum, status, total area, private area, bedrooms, bathrooms, and price. Uses a multi-URL navigate loop; add more Fincaraíz detail-page URLs to the navigate.urls array to process more inputs. Individual detail pages have no pagination, but each row in the project 'Tipos' table is exported as a separate CSV row.",
      "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: `(() => { const roots = Array.from(document.querySelectorAll('[id*=\"cookie\" i], [class*=\"cookie\" i], ...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1400,
      "position_y": 220,
      "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": "Structured export with JS columns (vivienda, vivienda_url, ubicacion, imagen_url, descripcion). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 220,
      "width": 340,
      "height": 133,
      "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": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}