{
  "version": "1.0.0",
  "exported_at": "2026-05-31T23:55:00.000Z",
  "project": {
    "name": "Idealista Details Scraper",
    "description": "Scrapes detailed property information from Idealista property detail URLs, including title, price, highlighted characteristics, location, advertiser comment, basic features, building info, equipment, energy certificate, reference, professional/agency, contact URL, image URL, page URL, and scrape timestamp. Uses a multi-URL navigation loop with append mode so all configured property URLs are collected into one CSV. If Idealista serves DataDome/CAPTCHA or a blocked page, the template writes a diagnostic row for that URL instead of silently producing blanks or no output. Attached analysis showed HTTP 403 DataDome/CAPTCHA, so full property extraction may require an accessible browser session, proxy, or manual access.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser viewport size",
      "position_x": 100,
      "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": 460,
      "position_y": 260,
      "config": {
        "urls": [
          "https://www.idealista.com/inmueble/102275671/",
          "https://www.idealista.com/inmueble/103585272/",
          "https://www.idealista.com/inmueble/102356410/"
        ],
        "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": 820,
      "position_y": 260,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1180,
      "position_y": 260,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1540,
      "position_y": 260,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1900,
      "position_y": 260,
      "config": {
        "selector": "h1.main-info__title-main, .main-info__title-main, .info-data-price, [class*=\"main-info__title\"], [class*=\"info-data-price\"]",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2260,
      "position_y": 80,
      "config": {
        "rowSelector": "body",
        "fileName": "idealista-detalles-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "URL_ingresadas",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Titulo",
            "selector": "(() => { const pick = (sels) => { for (const s of sels) { const el = ROW.querySelector(s); if (el) { const v = (el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim(); if (v) return v; } } return ''; }; const jsonTitle = (() => { for (const s of document.querySelectorAll('script[type=\"application/ld+json\"]')) { try { const j = JSON.parse(s.textContent || '{}'); const arr = Array.isArray(j) ? j : [j]; for (const o of arr) if (o && (o.name || o.headline)) return o.name || o.headline; } catch(e) {} } return ''; })(); return pick(['.main-info__title-main', 'h1.main-info__title-main', '[class*=\"title-main\"]', 'h1']) || jsonTitle; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Precio",
            "selector": "(() => { const pick = (sels) => { for (const s of sels) { const el = ROW.querySelector(s); if (el) { const v = (el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim(); if (v) return v; } } return ''; }; return pick(['.info-data-price', '[class*=\"info-data-price\"]', '[class*=\"price\"]']); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Características_destacadas",
            "selector": "(() => { const nodes = Array.from(ROW.querySelectorAll('.info-features span, .info-features li, [class*=\"info-features\"] span, [class*=\"info-features\"] li')); const vals = nodes.map(e => (e.innerText || e.textContent || '').replace(/\\s+/g, ' ').trim()).filter(Boolean); return Array.from(new Set(vals)).join('  '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Ubicación",
            "selector": "(() => { const pick = (sels) => { for (const s of sels) { const el = ROW.querySelector(s); if (el) { const v = (el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim(); if (v) return v; } } return ''; }; return pick(['.main-info__title-minor', '[class*=\"title-minor\"]', '.main-info__address', '[class*=\"address\"]']); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Comentario_del_anunciante",
            "selector": "(() => { const pick = (sels) => { for (const s of sels) { const el = ROW.querySelector(s); if (el) { const v = (el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim(); if (v) return v; } } return ''; }; return pick(['.comment', '.adCommentsLanguage', '#details .comment', '[class*=\"adComments\"]', '[class*=\"description\"]']); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Características_básicas",
            "selector": "(() => { const clean = s => (s || '').normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase(); const h = Array.from(ROW.querySelectorAll('h2,h3')).find(e => clean(e.textContent).includes('caracteristicas basicas')); if (!h) { const fallback = ROW.querySelector('.details-property_features, [class*=\"details-property_features\"]'); return fallback ? (fallback.innerText || fallback.textContent || '').replace(/\\s+/g, ' ').trim() : ''; } const out = []; let n = h.nextElementSibling; while (n && !/^H[23]$/.test(n.tagName)) { out.push(n.innerText || n.textContent || ''); n = n.nextElementSibling; } return out.join(' ').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Edificio",
            "selector": "(() => { const clean = s => (s || '').normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase(); const h = Array.from(ROW.querySelectorAll('h2,h3')).find(e => clean(e.textContent).trim() === 'edificio' || clean(e.textContent).includes('edificio')); if (!h) return ''; const out = []; let n = h.nextElementSibling; while (n && !/^H[23]$/.test(n.tagName)) { out.push(n.innerText || n.textContent || ''); n = n.nextElementSibling; } return out.join(' ').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Equipamiento",
            "selector": "(() => { const clean = s => (s || '').normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase(); const h = Array.from(ROW.querySelectorAll('h2,h3')).find(e => clean(e.textContent).includes('equipamiento')); if (!h) return ''; const out = []; let n = h.nextElementSibling; while (n && !/^H[23]$/.test(n.tagName)) { out.push(n.innerText || n.textContent || ''); n = n.nextElementSibling; } return out.join(' ').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Certificado_energetico",
            "selector": "(() => { const clean = s => (s || '').normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase(); const direct = ROW.querySelector('[class*=\"energy\"], [class*=\"energetic\"], [class*=\"certificate\"]'); if (direct) { const v = (direct.innerText || direct.textContent || '').replace(/\\s+/g, ' ').trim(); if (v) return v; } const h = Array.from(ROW.querySelectorAll('h2,h3')).find(e => clean(e.textContent).includes('certificado energetico')); if (!h) return ''; const out = []; let n = h.nextElementSibling; while (n && !/^H[23]$/.test(n.tagName)) { out.push(n.innerText || n.textContent || ''); n = n.nextElementSibling; } return out.join(' ').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Ref",
            "selector": "(() => { const el = ROW.querySelector('.txt-ref, .reference, [data-test*=\"reference\"], [class*=\"reference\"]'); if (el) { const v = (el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim(); if (v) return v.replace(/^Referencia:?\\s*/i, '').replace(/^Ref\\.?\\s*/i, ''); } const txt = ROW.innerText || ROW.textContent || ''; const m = txt.match(/(?:Referencia|Ref\\.?)[\\s:]+([A-Za-z0-9\\-\\/]+)/i); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Profesional",
            "selector": "(() => { const pick = (sels) => { for (const s of sels) { const el = ROW.querySelector(s); if (el) { const v = (el.innerText || el.textContent || '').replace(/\\s+/g, ' ').trim(); if (v) return v; } } return ''; }; const fromLink = pick(['a[href*=\"/pro/\"]']); if (fromLink) return fromLink; return pick(['.professional-name', '.advertiser-name', '[class*=\"professional\"] [class*=\"name\"]', '[class*=\"advertiser\"] [class*=\"name\"]']); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Contacto_URL",
            "selector": "(() => { const a = ROW.querySelector('a[href*=\"/pro/\"]'); if (!a) return ''; const href = a.getAttribute('href') || ''; return href ? new URL(href, location.href).href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Imagen",
            "selector": "(() => { const img = ROW.querySelector('img[src*=\"idealista.com/blur\"], img[src*=\"idealista.com\"], .gallery img, picture img'); if (!img) return ''; const src = img.currentSrc || img.getAttribute('src') || ''; return src ? new URL(src, location.href).href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Página_URL",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Hora_actual",
            "selector": "new Date().toISOString().replace('T', ' ').slice(0, 19)",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2620,
      "position_y": 80,
      "config": {
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "structured-export-2",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export blocked-page diagnostic row",
      "position_x": 2260,
      "position_y": 580,
      "config": {
        "rowSelector": "body",
        "fileName": "idealista-detalles-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#8d8d8d]",
        "columns": [
          {
            "name": "URL_ingresadas",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Titulo",
            "selector": "'BLOCKED_BY_DATADOME_OR_CAPTCHA'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Precio",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Características_destacadas",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Ubicación",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Comentario_del_anunciante",
            "selector": "(() => { const txt = (document.body && (document.body.innerText || document.body.textContent) || '').replace(/\\s+/g, ' ').trim(); const hasDataDome = document.querySelector('iframe[src*=\"captcha-delivery.com\"], script[src*=\"captcha-delivery.com\"], script[src*=\"datadome\"]') || txt.toLowerCase().includes('datadome') || txt.toLowerCase().includes('captcha'); return hasDataDome ? 'Idealista returned a DataDome/CAPTCHA or anti-bot interstitial, so property details were not accessible in this browser session.' : 'Property detail selectors were not found. The page may be blocked, unavailable, removed, or structurally changed.'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Características_básicas",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Edificio",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Equipamiento",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Certificado_energetico",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Ref",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Profesional",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Contacto_URL",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Imagen",
            "selector": "''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Página_URL",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Hora_actual",
            "selector": "new Date().toISOString().replace('T', ' ').slice(0, 19)",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-2",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2620,
      "position_y": 580,
      "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": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-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": "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": "structured-export-2",
      "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": "structured-export-2",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-2",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 28,
      "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": 388,
      "position_y": 156,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1828,
      "position_y": -24,
      "width": 1040,
      "height": 796,
      "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": 2188,
      "position_y": -24,
      "width": 380,
      "height": 796,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1",
          "structured-export-2"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes detailed property information from Idealista property detail URLs, including title, price, highlighted characteristics, location, advertiser comment, basic features, building info, equipment, energy certificate, reference, professional/agency, contact URL, image URL, page URL, and scrape timestamp. Uses a multi-URL navigation loop with append mode so all configured property URLs are collected into one CSV. If Idealista serves DataDome/CAPTCHA or a blocked page, the template writes a diagnostic row for that URL instead of silently producing blanks or no output. Attached analysis showed HTTP 403 DataDome/CAPTCHA, so full property extraction may require an accessible browser session, proxy, or manual access.",
      "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": 660,
      "position_y": 240,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `h1.main-info__title-main, .main-info__title-main, .info-data-price, [class*=\"main-info__title\"], [class*=\"info-data-pric`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2100,
      "position_y": 240,
      "width": 340,
      "height": 170,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (URL_ingresadas, Titulo, Precio, Características_destacadas, Ubicación). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2460,
      "position_y": 60,
      "width": 340,
      "height": 137,
      "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": 2820,
      "position_y": 60,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    },
    {
      "id": "note-block-structured-export-2",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (URL_ingresadas, Titulo, Precio, Características_destacadas, Ubicación). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2460,
      "position_y": 560,
      "width": 340,
      "height": 137,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-2"
      }
    },
    {
      "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": 2820,
      "position_y": 560,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-2"
      }
    }
  ]
}