{
  "version": "1.0.0",
  "exported_at": "2026-06-02T20:00:00.000Z",
  "project": {
    "name": "eInforma Details Scraper",
    "description": "Scrapes public company detail fields from eInforma detail-page URLs: detail_url, DENOMINACIÓN, DOMICILIO_SOCIAL, ANTIGÜEDAD, ACTIVIDAD_CNAE, FORMA_JURÍDICA, FECHA_DE_CONSTITUCIÓN and TELÉFONOS. Navigation strategy: multi-input URL loop using navigate.urls[] plus loop-continue; each detail page has no internal pagination, and all supplied URLs are appended into einforma-detalles-scraper.csv. If eInforma shows CAPTCHA or access controls, pause and solve manually if possible.",
    "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": {
        "urls": [
          "https://www.einforma.com/rapp/ficha-empresa?id=2Gk7PKh5l_cg5xLDzx5N9A&_=1713844954389",
          "https://einforma.com/rapp/ficha-empresa?id=3LiRfcRCNQeubrG-4_yxnw&_=1713844968806",
          "https://www.einforma.com/rapp/ficha-empresa?id=3PnD3dfe7iHWT30M4kl3mg&_=1713844979668"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "einforma",
          "detail-pages",
          "multi-url"
        ]
      }
    },
    {
      "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": 30
      }
    },
    {
      "block_id": "wait-for-text-1",
      "block_type": "process",
      "title": "Wait for Text",
      "description": "Wait until text appears",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "text": "Identificación",
        "selector": "body",
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "duration": 1
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "einforma-detalles-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "detail_url",
            "selector": "(() => location.href)()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "DENOMINACIÓN",
            "selector": "(() => { const h = document.querySelector('h2'); if (h && h.textContent.trim()) return h.textContent.trim(); const t = document.body.innerText.replace(/\\s+/g, ' ').trim(); const m = t.match(/DENOMINACIÓN\\s+(.+?)\\s+(?:TELÉFONOS|DOMICILIO SOCIAL|ÚLTIMA ACTUALIZACIÓN)/); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "DOMICILIO_SOCIAL",
            "selector": "(() => { const t = document.body.innerText.replace(/\\s+/g, ' ').trim(); const label = 'DOMICILIO SOCIAL'; const i = t.indexOf(label); if (i < 0) return ''; const s = i + label.length; let end = t.length; ['PÁGINA WEB', 'CIBERSCORING', 'ÚLTIMA ACTUALIZACIÓN', 'BALANCES', 'ANTIGÜEDAD'].forEach(e => { const j = t.indexOf(e, s); if (j >= 0 && j < end) end = j; }); return t.slice(s, end).replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ANTIGÜEDAD",
            "selector": "(() => { const t = document.body.innerText.replace(/\\s+/g, ' ').trim(); const label = 'ANTIGÜEDAD'; const i = t.indexOf(label); if (i < 0) return ''; const s = i + label.length; let end = t.length; ['Información de la empresa', 'ACTIVIDAD CNAE', 'FORMA JURÍDICA'].forEach(e => { const j = t.indexOf(e, s); if (j >= 0 && j < end) end = j; }); const raw = t.slice(s, end).trim(); const m = raw.match(/(\\d+)\\s*años?/i); return m ? m[1] : raw; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ACTIVIDAD_CNAE",
            "selector": "(() => { const t = document.body.innerText.replace(/\\s+/g, ' ').trim(); const m = t.match(/ACTIVIDAD CNAE(?:\\s+2009(?:\\s*-\\s*2025)?|\\s+2009)?\\s+(.+?)\\s+(?:ACTIVIDAD CNAE\\s+2025|FORMA JURÍDICA)/); return m ? m[1].replace(/\\s+/g, ' ').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "FORMA_JURÍDICA",
            "selector": "(() => { const t = document.body.innerText.replace(/\\s+/g, ' ').trim(); const label = 'FORMA JURÍDICA'; const i = t.indexOf(label); if (i < 0) return ''; const s = i + label.length; let end = t.length; ['FECHA DE CONSTITUCIÓN', 'OBJETO SOCIAL', 'Información financiera disponible', 'Esta empresa ha sido consultada'].forEach(e => { const j = t.indexOf(e, s); if (j >= 0 && j < end) end = j; }); return t.slice(s, end).replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "FECHA_DE_CONSTITUCIÓN",
            "selector": "(() => { const t = document.body.innerText.replace(/\\s+/g, ' ').trim(); let raw = ''; const label = 'FECHA DE CONSTITUCIÓN'; const i = t.indexOf(label); if (i >= 0) { const s = i + label.length; let end = t.length; ['OBJETO SOCIAL', 'Información financiera disponible', 'Esta empresa ha sido consultada'].forEach(e => { const j = t.indexOf(e, s); if (j >= 0 && j < end) end = j; }); raw = t.slice(s, end).trim(); } if (!raw) { const m2 = t.match(/Constituida en fecha\\s+(\\d{2}\\/\\d{2}\\/\\d{4})/); raw = m2 ? m2[1] : ''; } const m = raw.match(/(\\d{2})\\/(\\d{2})\\/(\\d{4})/); return m ? `${m[3]}-${m[2]}-${m[1]}` : raw.replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "TELÉFONOS",
            "selector": "(() => { const t = document.body.innerText.replace(/\\s+/g, ' ').trim(); const label = 'TELÉFONOS'; const i = t.indexOf(label); if (i < 0) return ''; const s = i + label.length; let end = t.length; ['DOMICILIO SOCIAL', 'PÁGINA WEB', 'ÚLTIMA ACTUALIZACIÓN', 'BALANCES', 'ANTIGÜEDAD'].forEach(e => { const j = t.indexOf(e, s); if (j >= 0 && j < end) end = j; }); return t.slice(s, end).replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1920,
      "position_y": 260,
      "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-text-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-text-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": "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-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 156,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-text-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1488,
      "position_y": 156,
      "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": 1848,
      "position_y": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes public company detail fields from eInforma detail-page URLs: detail_url, DENOMINACIÓN, DOMICILIO_SOCIAL, ANTIGÜEDAD, ACTIVIDAD_CNAE, FORMA_JURÍDICA, FECHA_DE_CONSTITUCIÓN and TELÉFONOS. Navigation strategy: multi-input URL loop using navigate.urls[] plus loop-continue; each detail page has no internal pagination, and all supplied URLs are appended into einforma-detalles-scraper.csv. If eInforma shows CAPTCHA or access controls, pause and solve manually if possible.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (detail_url, DENOMINACIÓN, DOMICILIO_SOCIAL, ANTIGÜEDAD, ACTIVIDAD_CNAE). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 240,
      "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": 2120,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}