{
  "version": "1.0.0",
  "exported_at": "2026-05-31T10:00:00.000Z",
  "project": {
    "name": "Google Maps Leads Scraper by URLs",
    "description": "Best-effort Google Maps leads scraper for Google Maps search result page URLs. Google Maps uses a virtualized infinite-scroll feed, so this template starts an in-page JavaScript collector that repeatedly captures currently visible business cards into a hidden buffer while scrolling candidate feed containers. After a bounded wait, the accumulated unique cards are exported to CSV. Extracts listing-visible fields equivalent to the Octoparse template: keyword, source URL, business title, rating, review count, address/category/price/status, Google Maps detail URL, coordinates from the detail URL, thumbnail image, delivery/service signals, and listing description when visible. Some richer Octoparse fields such as phone, website, full weekly hours, plus code, and extra images may be blank unless Google exposes them in the search result card. Google Maps may also change selectors, virtualize results, limit loading, or show CAPTCHA/bot checks.",
    "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": 100,
      "position_y": 220,
      "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": 220,
      "config": {
        "urls": [
          "https://www.google.com/maps/search/restaurants+in+London/@51.5126134,-0.1546706,13z"
        ],
        "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": 820,
      "position_y": 220,
      "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": 220,
      "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": 220,
      "config": {
        "selector": "div[role=\"article\"][aria-label]",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1900,
      "position_y": 220,
      "config": {
        "jsCode": "(function(){ if(window.__uscraperGmapsTimer){ clearInterval(window.__uscraperGmapsTimer); } const old=document.getElementById('uscraper-gmaps-buffer'); if(old){ old.remove(); } const buffer=document.createElement('div'); buffer.id='uscraper-gmaps-buffer'; buffer.style.cssText='display:none !important;'; document.body.appendChild(buffer); const clean=s=>(s||'').replace(/\\s+/g,' ').trim(); const pageUrl=window.location.href; const km=pageUrl.match(/\\/maps\\/search\\/([^\\/@?]+)/); const keyword=km?decodeURIComponent(km[1]).replace(/\\+/g,' '):''; const bm=pageUrl.match(/@(-?\\d+(?:\\.\\d+)?),(-?\\d+(?:\\.\\d+)?),/); const latBackup=bm?bm[1]:''; const lonBackup=bm?bm[2]:''; function parseCard(row){ const link=row.querySelector('a.hfpxzc[href*=\"/maps/place/\"]')||row.querySelector('a.hfpxzc'); const href=link?link.href:''; const title=clean((link&&link.getAttribute('aria-label'))||row.getAttribute('aria-label')||''); const rating=clean(row.querySelector('.MW4etd')?.textContent||''); const reviews=clean((row.querySelector('.UY7F9')?.textContent||'').replace(/[()]/g,'')); const infos=Array.from(row.querySelectorAll('.W4Efsd')).map(e=>clean(e.innerText||e.textContent)).filter(Boolean); const catLine=infos.find(t=>t.includes('·')&&!/\\d\\.\\d\\s*\\(/.test(t)&&!/(Open|Closed|Dine-in|Takeout|Delivery)/i.test(t))||''; const parts=catLine.split('·').map(clean).filter(Boolean); const category=parts.find(s=>!/[£$€]/.test(s))||''; const addressParts=parts.filter(s=>!/[£$€]/.test(s)); const address=addressParts.length>1?addressParts[addressParts.length-1]:''; const text=row.innerText||''; const phoneMatch=text.match(/\\+\\d[\\d\\s().-]{7,}\\d/); const openMatch=text.match(/\\b(Open|Closed)\\b[^\\n]*/i); const priceMatch=text.match(/[£$€]\\s?\\d+(?:[–-]\\s?[£$€]?\\d+|\\+)?|[£$€]{2,4}/); const plusMatch=text.match(/[23456789CFGHJMPQRVWX]{4}\\+[23456789CFGHJMPQRVWX]{2}(?:\\s[^\\n]+)?/); const coord=href.match(/!3d(-?\\d+(?:\\.\\d+)?)!4d(-?\\d+(?:\\.\\d+)?)/); const imgs=Array.from(row.querySelectorAll('img[src*=\"googleusercontent\"], img[src^=\"https://lh\"]')).map(i=>i.src).filter(Boolean); const websiteLink=Array.from(row.querySelectorAll('a[href]')).find(a=>!a.href.includes('/maps/place/')&&!a.href.includes('google.com/maps')&&!a.href.includes('google.com/aclk')&&!a.href.includes('google.com/url')&&!a.href.startsWith('tel:')); const lines=text.split('\\n').map(clean).filter(Boolean); const description=lines.find(s=>s!==title&&s.length>30&&!/reviews?|stars?|Open|Closed|Dine-in|Takeout|Delivery/i.test(s))||''; return {keyword:keyword,page_url:pageUrl,title:title,reviews:reviews,total_rating:rating,address:address,website:websiteLink?websiteLink.href:'',phone:phoneMatch?clean(phoneMatch[0]):'',open_time:openMatch?clean(openMatch[0]):'',detail_url:href,latitude:coord?coord[1]:'',longitude:coord?coord[2]:'',latitude_backup:latBackup,longitude_backup:lonBackup,category:category,main_image:imgs[0]||'',image_1:imgs[1]||'',image_2:imgs[2]||'',image_3:imgs[3]||'',description:description,price_range:priceMatch?clean(priceMatch[0]):'',current_status:openMatch?clean(openMatch[0]):'',plus_code_url:'',plus_code:plusMatch?clean(plusMatch[0]):'',delivery:/Delivery/i.test(text)?'Delivery':''}; } function addCard(data){ if(!data.detail_url&&!data.title){ return; } const id=data.detail_url||data.title; if(buffer.querySelector('[data-uscraper-id=\"'+CSS.escape(id)+'\"]')){ return; } const div=document.createElement('div'); div.className='uscraper-gmaps-row'; div.setAttribute('data-uscraper-id',id); Object.keys(data).forEach(k=>div.setAttribute('data-'+k.replace(/_/g,'-'),data[k]||'')); buffer.appendChild(div); } function collect(){ document.querySelectorAll('div[role=\"article\"][aria-label]').forEach(r=>addCard(parseCard(r))); } function scrollCandidates(){ const feed=document.querySelector('[role=\"feed\"]'); if(feed){ feed.scrollTop+=1400; feed.dispatchEvent(new WheelEvent('wheel',{bubbles:true,cancelable:true,deltaY:1800})); } const nodes=Array.from(document.querySelectorAll('div')).filter(el=>el.scrollHeight>el.clientHeight+80); nodes.sort((a,b)=>(b.scrollHeight-b.clientHeight)-(a.scrollHeight-a.clientHeight)); nodes.slice(0,8).forEach(el=>{ try{ el.scrollTop+=1400; el.dispatchEvent(new WheelEvent('wheel',{bubbles:true,cancelable:true,deltaY:1800})); }catch(e){} }); window.scrollBy(0,900); } window.__uscraperGmapsRounds=0; window.__uscraperGmapsStable=0; window.__uscraperGmapsLastCount=0; collect(); window.__uscraperGmapsTimer=setInterval(function(){ collect(); scrollCandidates(); setTimeout(collect,500); window.__uscraperGmapsRounds++; const c=buffer.children.length; if(c<=window.__uscraperGmapsLastCount){ window.__uscraperGmapsStable++; } else { window.__uscraperGmapsStable=0; window.__uscraperGmapsLastCount=c; } if(window.__uscraperGmapsRounds>=55||window.__uscraperGmapsStable>=14||/you\\s+have\\s+reached\\s+the\\s+end|you've\\s+reached\\s+the\\s+end|end\\s+of\\s+the\\s+list/i.test(document.body.innerText||'')){ clearInterval(window.__uscraperGmapsTimer); collect(); } },1200); })();",
        "waitForCompletion": false,
        "timeout": 10,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2260,
      "position_y": 220,
      "config": {
        "duration": 70,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 2620,
      "position_y": 220,
      "config": {
        "selector": "#uscraper-gmaps-buffer .uscraper-gmaps-row",
        "timeout": 20,
        "visible": false,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2980,
      "position_y": 220,
      "config": {
        "rowSelector": "#uscraper-gmaps-buffer .uscraper-gmaps-row",
        "fileName": "google-maps-scraper-store-details-by-url.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "keyword",
            "selector": "",
            "attribute": "data-keyword"
          },
          {
            "name": "page_url",
            "selector": "",
            "attribute": "data-page-url"
          },
          {
            "name": "title",
            "selector": "",
            "attribute": "data-title"
          },
          {
            "name": "reviews",
            "selector": "",
            "attribute": "data-reviews"
          },
          {
            "name": "total_rating",
            "selector": "",
            "attribute": "data-total-rating"
          },
          {
            "name": "address",
            "selector": "",
            "attribute": "data-address"
          },
          {
            "name": "website",
            "selector": "",
            "attribute": "data-website"
          },
          {
            "name": "phone",
            "selector": "",
            "attribute": "data-phone"
          },
          {
            "name": "open_time",
            "selector": "",
            "attribute": "data-open-time"
          },
          {
            "name": "detail_url",
            "selector": "",
            "attribute": "data-detail-url"
          },
          {
            "name": "latitude",
            "selector": "",
            "attribute": "data-latitude"
          },
          {
            "name": "longitude",
            "selector": "",
            "attribute": "data-longitude"
          },
          {
            "name": "latitude_backup",
            "selector": "",
            "attribute": "data-latitude-backup"
          },
          {
            "name": "longitude_backup",
            "selector": "",
            "attribute": "data-longitude-backup"
          },
          {
            "name": "category",
            "selector": "",
            "attribute": "data-category"
          },
          {
            "name": "main_image",
            "selector": "",
            "attribute": "data-main-image"
          },
          {
            "name": "image_1",
            "selector": "",
            "attribute": "data-image-1"
          },
          {
            "name": "image_2",
            "selector": "",
            "attribute": "data-image-2"
          },
          {
            "name": "image_3",
            "selector": "",
            "attribute": "data-image-3"
          },
          {
            "name": "description",
            "selector": "",
            "attribute": "data-description"
          },
          {
            "name": "price_range",
            "selector": "",
            "attribute": "data-price-range"
          },
          {
            "name": "current_status",
            "selector": "",
            "attribute": "data-current-status"
          },
          {
            "name": "plus_code_url",
            "selector": "",
            "attribute": "data-plus-code-url"
          },
          {
            "name": "plus_code",
            "selector": "",
            "attribute": "data-plus-code"
          },
          {
            "name": "delivery",
            "selector": "",
            "attribute": "data-delivery"
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 3340,
      "position_y": 220,
      "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": "wait-for-element-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-2",
      "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": 28,
      "position_y": 116,
      "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": 116,
      "width": 2480,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "sleep-2",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1828,
      "position_y": 116,
      "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": 2908,
      "position_y": 116,
      "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": 3268,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort Google Maps leads scraper for Google Maps search result page URLs. Google Maps uses a virtualized infinite-scroll feed, so this template starts an in-page JavaScript collector that repeatedly captures currently visible business cards into a hidden buffer while scrolling candidate feed containers. After a bounded wait, the accumulated unique cards are exported to CSV. Extracts listing-visible fields equivalent to the Octoparse template: keyword, source URL, business title, rating, review count, address/category/price/status, Google Maps detail URL, coordinates from the detail URL, thumbnail image, delivery/service signals, and listing description when visible. Some richer Octoparse fields such as phone, website, full weekly hours, plus code, and extra images may be blank unless Google exposes them in the search result card. Google Maps may also change selectors, virtualize results, limit loading, or show CAPTCHA/bot checks.",
      "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: `(function(){ if(window.__uscraperGmapsTimer){ clearInterval(window.__uscraperGmapsTimer); } const ol...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 2100,
      "position_y": 200,
      "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": "Extracts rows matching `#uscraper-gmaps-buffer .uscraper-gmaps-row`. Confirm row count > 0 before running at scale.",
      "color": "#ee5396",
      "position_x": 3180,
      "position_y": 200,
      "width": 340,
      "height": 118,
      "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": 3540,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}