{
  "version": "1.0.0",
  "exported_at": "2026-05-31T12:35:00.000Z",
  "project": {
    "name": "Google Maps Listing Scraper Spanish",
    "description": "Scrapes Spanish Google Maps business detail pages for keyword-style lead data: keyword, title, URL, rating, reviews, category, address, website, phone, latitude, longitude, hours, and scrape time. Navigation uses a multi-URL loop over pre-enumerated Google Maps place URLs; replace or extend the urls[] list with place URLs discovered for your keywords/pages. Google Maps may throttle, show CAPTCHA, or change DOM selectors.",
    "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": 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.google.es/maps/place/Bar+Madrid/data=!4m5!3m4!1s0x997e53387c57f5:0xba1681b5cf223070!8m2!3d-22.9187197!4d-43.2140803?authuser=0&hl=es&rclk=1",
          "https://www.google.es/maps/place/Bar+La+Alegría/data=!4m5!3m4!1s0xd4229001a9dfce7:0xb43e7b66ff4fef0d!8m2!3d40.4195227!4d-3.7076668?authuser=0&hl=es&rclk=1",
          "https://www.google.es/maps/place/Edén+de+Huertas+Bar+de+Copas+y+Cachimbas/data=!4m5!3m4!1s0xd422882780f5db9:0xe252acb215cffb1e!8m2!3d40.4132096!4d-3.6958933?authuser=0&hl=es&rclk=1"
        ],
        "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": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "selector": "h1.DUwDvf, h1",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "selector": ".OMl5r",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "selector": ".OMl5r",
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2640,
      "position_y": 240,
      "config": {
        "duration": 1,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 3000,
      "position_y": 560,
      "config": {
        "rowSelector": "body",
        "fileName": "google-maps-scraper-tiendas-detalles-palabrasclave.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "palabra_clave",
            "selector": "\"bar en Madrid\"",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "titulo",
            "selector": "(ROW.querySelector('h1.DUwDvf, h1')?.innerText || '').trim()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(Array.from(ROW.querySelectorAll('.F7nice span[aria-hidden]')).map(e => e.textContent.trim()).find(t => /^\\d+[,.]\\d+$/.test(t)) || '')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "resenas",
            "selector": "(function(){const label=Array.from(ROW.querySelectorAll('.F7nice span[aria-label]')).map(e=>e.getAttribute('aria-label')||'').find(a=>/reseñ/i.test(a))||''; const m=label.match(/[\\d.,]+/); return m ? m[0].replace(/[().]/g,'') : '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "categoria",
            "selector": "(ROW.querySelector('button.DkEaL')?.innerText || '').trim()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "direccion",
            "selector": "(function(){const e=ROW.querySelector('[data-item-id=\"address\"]'); const t=e?.getAttribute('aria-label') || e?.innerText || ''; return t.replace(/^Dirección:\\s*/i,'').trim();})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "sitio_web",
            "selector": "(function(){return Array.from(ROW.querySelectorAll('a[href^=\"http\"]')).map(a=>a.href).find(h=>!/(^https?:\\/\\/(www\\.)?google\\.|support\\.google|accounts\\.google|gstatic|schema\\.org)/i.test(h)) || '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "telefono",
            "selector": "(function(){const e=ROW.querySelector('[data-item-id^=\"phone:\"]'); const tel=ROW.querySelector('a[href^=\"tel:\"]'); const t=e?.getAttribute('aria-label') || e?.innerText || (tel?.getAttribute('href') || '').replace(/^tel:/,'') || ''; return t.replace(/^Teléfono:\\s*/i,'').trim();})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "latitud",
            "selector": "(function(){const u=decodeURIComponent(location.href); let m=u.match(/@(-?\\d+\\.\\d+),(-?\\d+\\.\\d+)/); if(m) return m[1]; m=u.match(/!3d(-?\\d+\\.\\d+)!4d(-?\\d+\\.\\d+)/); return m ? m[1] : '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "longitud",
            "selector": "(function(){const u=decodeURIComponent(location.href); let m=u.match(/@(-?\\d+\\.\\d+),(-?\\d+\\.\\d+)/); if(m) return m[2]; m=u.match(/!3d(-?\\d+\\.\\d+)!4d(-?\\d+\\.\\d+)/); return m ? m[2] : '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "horario",
            "selector": "(function(){const rows=Array.from(ROW.querySelectorAll('table.eK4R0e tr')); if(rows.length){return rows.map(r=>{const day=(r.querySelector('td:first-child')?.innerText||'').trim(); const val=((r.querySelector('td:nth-child(2)')?.getAttribute('aria-label')) || (r.querySelector('td:nth-child(2)')?.innerText) || '').trim(); return [day,val].filter(Boolean).join(' ');}).join('\\n');} return (ROW.querySelector('.OqCZI .ZDu9vd')?.innerText || '').trim();})()",
            "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": 3360,
      "position_y": 560,
      "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-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": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-1",
      "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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "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": 2480,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1848,
      "position_y": 136,
      "width": 1760,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2928,
      "position_y": 456,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Spanish Google Maps business detail pages for keyword-style lead data: keyword, title, URL, rating, reviews, category, address, website, phone, latitude, longitude, hours, and scrape time. Navigation uses a multi-URL loop over pre-enumerated Google Maps place URLs; replace or extend the urls[] list with place URLs discovered for your keywords/pages. Google Maps may throttle, show CAPTCHA, or change DOM selectors.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `.OMl5r`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 220,
      "width": 340,
      "height": 132,
      "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 (palabra_clave, titulo, url, rating, resenas). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 3200,
      "position_y": 540,
      "width": 340,
      "height": 128,
      "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": 3560,
      "position_y": 540,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}