{
  "version": "1.0.0",
  "exported_at": "2026-05-31T18:30:00.000Z",
  "project": {
    "name": "Idealista Listing Pages Scraper",
    "description": "Scrapes Idealista Spain listing pages for property title, listing URL, price, characteristics, description, and address/location text. Uses a click-next pagination loop to collect all available result pages when listings are accessible. Idealista returned a DataDome CAPTCHA/HTTP 403 during analysis and autonomous testing; this template therefore checks for listing rows before extraction and exits cleanly if blocked. To collect data, run in a browser session where the CAPTCHA has been manually solved, use an allowed network/session, or provide a warmed Idealista profile.",
    "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": {
        "url": "https://www.idealista.com/venta-viviendas/barcelona/les-corts/les-corts/",
        "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": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "jsCode": "(() => {\n  const selectors = [\n    '#didomi-notice-agree-button',\n    'button#didomi-notice-agree-button',\n    'button[data-testid=\"TcfAccept\"]',\n    'button[mode=\"primary\"]'\n  ];\n  for (const selector of selectors) {\n    const button = document.querySelector(selector);\n    if (button && /acept|accept|agree|consent/i.test(button.textContent || button.value || '')) {\n      button.click();\n      return 'Cookie/consent button clicked: ' + selector;\n    }\n  }\n  return 'No cookie/consent button found';\n})()",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "duration": 5
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "selector": "article.item"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "rowSelector": "article.item",
        "fileName": "idealista-listados-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "url_ingresada",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "titulo",
            "selector": ".item-info-container a.item-link, a.item-link",
            "attribute": "text"
          },
          {
            "name": "url",
            "selector": ".item-info-container a.item-link, a.item-link",
            "attribute": "href"
          },
          {
            "name": "precio",
            "selector": ".item-price",
            "attribute": "text"
          },
          {
            "name": "caracteristica_1",
            "selector": "Array.from(ROW.querySelectorAll('.item-detail-char .item-detail, .item-detail')).map(e => e.textContent.trim()).filter(Boolean)[0] || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "caracteristica_2",
            "selector": "Array.from(ROW.querySelectorAll('.item-detail-char .item-detail, .item-detail')).map(e => e.textContent.trim()).filter(Boolean)[1] || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "caracteristica_3",
            "selector": "Array.from(ROW.querySelectorAll('.item-detail-char .item-detail, .item-detail')).map(e => e.textContent.trim()).filter(Boolean)[2] || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "descripcion",
            "selector": ".item-description, .item-description p",
            "attribute": "text"
          },
          {
            "name": "direccion_o_zona",
            "selector": "(() => { const title = ROW.querySelector('.item-info-container a.item-link, a.item-link')?.textContent?.trim() || ''; return title.replace(/^(Piso|Casa|Chalet|Dúplex|Ático|Estudio|Apartamento|Finca|Local|Garaje)\\s+en\\s+/i, ''); })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "selector": ".pagination a.icon-arrow-right-after[href], .pagination a[rel=\"next\"], .pagination a[title*=\"Siguiente\"], .pagination a[aria-label*=\"iguiente\"], a[rel=\"next\"]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 2640,
      "position_y": 620,
      "config": {
        "selector": ".pagination a.icon-arrow-right-after[href], .pagination a[rel=\"next\"], .pagination a[title*=\"Siguiente\"], .pagination a[aria-label*=\"iguiente\"], a[rel=\"next\"]",
        "timeout": 15
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 3000,
      "position_y": 620,
      "config": {
        "timeout": 45
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3360,
      "position_y": 620,
      "config": {
        "duration": 3
      }
    },
    {
      "block_id": "element-exists-3",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 3720,
      "position_y": 620,
      "config": {
        "selector": "article.item"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 1560,
      "position_y": 620,
      "config": {}
    },
    {
      "block_id": "end-2",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2280,
      "position_y": 620,
      "config": {}
    },
    {
      "block_id": "end-3",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 3720,
      "position_y": 940,
      "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": "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": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "element-exists-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "true",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "false",
      "to_block_id": "end-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-page-load-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-page-load-2",
      "from_connector_id": "right",
      "to_block_id": "sleep-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "from_connector_id": "right",
      "to_block_id": "element-exists-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-3",
      "from_connector_id": "true",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-3",
      "from_connector_id": "false",
      "to_block_id": "end-3",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 156,
      "width": 3560,
      "height": 656,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-page-load-2",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 768,
      "position_y": 156,
      "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": 1488,
      "position_y": 156,
      "width": 2480,
      "height": 656,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "element-exists-2",
          "click-1",
          "element-exists-3"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 1488,
      "position_y": 516,
      "width": 2480,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1",
          "end-2",
          "end-3"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Idealista Spain listing pages for property title, listing URL, price, characteristics, description, and address/location text. Uses a click-next pagination loop to collect all available result pages when listings are accessible. Idealista returned a DataDome CAPTCHA/HTTP 403 during analysis and autonomous testing; this template therefore checks for listing rows before extraction and exits cleanly if blocked. To collect data, run in a browser session where the CAPTCHA has been manually solved, use an allowed network/session, or provide a warmed Idealista profile.",
      "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: `(() => {\n  const selectors = [\n    '#didomi-notice-agree-button',\n    'button#didomi-notice-agree-bu...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 240,
      "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 `article.item`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 240,
      "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": "Structured export with JS columns (url_ingresada, caracteristica_1, caracteristica_2, caracteristica_3, direccion_o_zona). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 240,
      "width": 340,
      "height": 142,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-2",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `.pagination a.icon-arrow-right-after[href], .pagination a[rel=\"next\"], .pagination a[title*=\"Siguiente\"], .pagination a[`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 240,
      "width": 340,
      "height": 170,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-2"
      }
    },
    {
      "id": "note-block-click-1",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Pagination click — add waits after this block; the page reloads asynchronously.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 600,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    },
    {
      "id": "note-block-element-exists-3",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `article.item`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 3920,
      "position_y": 600,
      "width": 340,
      "height": 134,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-3"
      }
    }
  ]
}