{
  "version": "1.0.0",
  "exported_at": "2026-06-01T00:00:00.000Z",
  "project": {
    "name": "Google Play App Scraper",
    "description": "Scrapes Google Play app search results for the default keyword \"Video editing\" and exports app name, rating, company/developer, and app detail URL. The template targets https://play.google.com/store/search?q=Video%20editing&c=apps. Google Play does not provide stable numbered pagination on the search page, so this template performs lazy-load scrolling before extraction to collect all loaded results. Edit the q= keyword in the Navigate block to scrape another keyword. Google may show consent, CAPTCHA, or anti-bot pages in some sessions.",
    "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": 300,
      "config": {
        "url": "https://play.google.com/store/search?q=Video%20editing&c=apps",
        "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": 300,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 840,
      "position_y": 300,
      "config": {
        "selector": "//button[contains(normalize-space(.), 'Accept all') or contains(normalize-space(.), 'I agree')]",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1200,
      "position_y": 120,
      "config": {
        "selector": "//button[contains(normalize-space(.), 'Accept all') or contains(normalize-space(.), 'I agree')]",
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 120,
      "config": {
        "duration": 2,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1920,
      "position_y": 120,
      "config": {
        "selector": "a[href^=\"/store/apps/details?id=\"], a[href^=\"https://play.google.com/store/apps/details?id=\"]",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 580,
      "config": {
        "selector": "a[href^=\"/store/apps/details?id=\"], a[href^=\"https://play.google.com/store/apps/details?id=\"]",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 2280,
      "position_y": 300,
      "config": {
        "jsCode": "(() => { window.__uscraperGooglePlayScrollDone = false; const maxSteps = 25; const delay = 800; let i = 0; const tick = () => { window.scrollBy(0, Math.max(window.innerHeight * 0.9, 900)); i += 1; if (i < maxSteps) { setTimeout(tick, delay); } else { window.__uscraperGooglePlayScrollDone = true; } }; tick(); return true; })();",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2640,
      "position_y": 300,
      "config": {
        "duration": 22,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 3000,
      "position_y": 300,
      "config": {
        "rowSelector": "a[href^=\"/store/apps/details?id=\"], a[href^=\"https://play.google.com/store/apps/details?id=\"]",
        "fileName": "google-play-app-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "create",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "Name_of_App",
            "selector": "(() => { const label=(ROW.getAttribute('aria-label')||'').trim(); if(label && !['install','open'].includes(label.toLowerCase())) return label; const lines=(ROW.innerText||ROW.textContent||'').split(/\\n+/).map(s=>s.trim()).filter(Boolean); return lines[0]||''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Rating",
            "selector": "(() => { const text=(ROW.innerText||ROW.textContent||ROW.getAttribute('aria-label')||''); const m=text.match(/([0-5](?:\\.\\d)?)\\s*star/i)||text.match(/Rated\\s*([0-5](?:\\.\\d)?)/i)||text.match(/\\b([0-5]\\.\\d)\\b/); return m?m[1]:''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Company",
            "selector": "(() => { const lines=(ROW.innerText||ROW.textContent||'').split(/\\n+/).map(s=>s.trim()).filter(Boolean); const bad=s=>/star|rating|contains ads|in-app purchases|installed|open|install/i.test(s)||/^[0-5](\\.\\d)?$/.test(s); for(let i=1;i<lines.length;i++){ if(!bad(lines[i])) return lines[i]; } const leaves=Array.from(ROW.querySelectorAll('div,span')).filter(e=>e.children.length===0).map(e=>(e.innerText||e.textContent||'').trim()).filter(Boolean); for(let i=1;i<leaves.length;i++){ if(!bad(leaves[i])) return leaves[i]; } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "App_Detail_Web_Page_URL",
            "selector": "(() => { const href=ROW.getAttribute('href')||''; try { return new URL(href, location.origin).href; } catch(e) { return href; } })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 3360,
      "position_y": 300,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": "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-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": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "wait-for-element-2",
      "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": "wait-for-element-2",
      "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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 16,
      "width": 2840,
      "height": 756,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "wait-for-element-2",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 768,
      "position_y": 16,
      "width": 680,
      "height": 476,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 2208,
      "position_y": 196,
      "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": 2928,
      "position_y": 196,
      "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": 3288,
      "position_y": 196,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Google Play app search results for the default keyword \"Video editing\" and exports app name, rating, company/developer, and app detail URL. The template targets https://play.google.com/store/search?q=Video%20editing&c=apps. Google Play does not provide stable numbered pagination on the search page, so this template performs lazy-load scrolling before extraction to collect all loaded results. Edit the q= keyword in the Navigate block to scrape another keyword. Google may show consent, CAPTCHA, or anti-bot pages in some sessions.",
      "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 `//button[contains(normalize-space(.), 'Accept all') or contains(normalize-space(.), 'I agree')]`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 280,
      "width": 340,
      "height": 162,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(() => { window.__uscraperGooglePlayScrollDone = false; const maxSteps = 25; const delay = 800; let ...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 280,
      "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": "Structured export with JS columns (Name_of_App, Rating, Company, App_Detail_Web_Page_URL). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 3200,
      "position_y": 280,
      "width": 340,
      "height": 131,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    }
  ]
}