{
  "version": "1.0.0",
  "exported_at": "2026-06-01T00:00:00.000Z",
  "project": {
    "name": "Zillow Listing Scraper by keyword",
    "description": "Scrapes Zillow property listing data for keyword Seattle in buy/for-sale mode. Extracts keyword, image URL, property URL, price, beds, baths, square feet, status, address, and listing source. Pagination is implemented as a guarded Next-page loop: the current page is exported first, then the template checks for Zillow CAPTCHA/PerimeterX iframe and ends cleanly if present; otherwise it navigates to a[rel=\"next\"] via JavaScript instead of physical click to reduce click-interception failures. Best-effort only: Zillow may show CAPTCHA, bot checks, cookie prompts, or layout changes; manually solve CAPTCHA in the browser if required.",
    "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": 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": 456,
      "position_y": 220,
      "config": {
        "url": "https://www.zillow.com/seattle-wa/",
        "color": "bg-[#4589ff]",
        "tags": [
          "zillow",
          "keyword:Seattle",
          "buy",
          "guarded-next-pagination"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript on the page",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "jsCode": "(() => { const choices = ['accept','agree','allow all','i agree']; const buttons = Array.from(document.querySelectorAll('button,[role=button],input[type=button],input[type=submit]')); const btn = buttons.find(b => choices.some(t => ((b.innerText || b.value || b.textContent || '').trim().toLowerCase()).includes(t))); if (btn) { btn.click(); return 'clicked consent'; } return 'no consent banner'; })()",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "duration": 5,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1800,
      "position_y": 220,
      "config": {
        "rowSelector": "article:has(a[href*=\"/homedetails/\"])",
        "fileName": "zillow-scraper-by-keywords.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "keyword",
            "selector": "'Seattle'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url",
            "selector": "(() => { const img = ROW.querySelector('img[src*=\"zillowstatic.com\"], img[src], img[data-src]'); return img ? (img.currentSrc || img.src || img.getAttribute('data-src') || '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "house_url",
            "selector": "(() => { const a = ROW.querySelector('a[href*=\"/homedetails/\"]') || ROW.querySelector('a[href]'); return a ? new URL(a.getAttribute('href'), location.origin).href.split('?')[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const parts = [ROW.innerText || '', ROW.textContent || '']; ROW.querySelectorAll('[aria-label],[title]').forEach(e => { parts.push(e.getAttribute('aria-label') || ''); parts.push(e.getAttribute('title') || ''); }); const text = parts.join(' '); const m = text.match(/\\$[\\d,.]+\\s*[KMB]?/i); return m ? m[0].replace(/\\s+/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "bedroom_s_",
            "selector": "(() => { const parts = [ROW.innerText || '', ROW.textContent || '']; ROW.querySelectorAll('[aria-label],[title]').forEach(e => { parts.push(e.getAttribute('aria-label') || ''); parts.push(e.getAttribute('title') || ''); }); const text = parts.join(' '); let m = text.match(/(\\d+(?:\\.\\d+)?)\\s*(?:bd|bds|bed|beds|bedroom|bedrooms)(?![a-z])/i); if (m) return m[1]; const a = ROW.querySelector('a[href*=\"/homedetails/\"]'); const href = a ? new URL(a.getAttribute('href'), location.origin).href.split('?')[0] : ''; if (!href) return ''; for (const s of Array.from(document.querySelectorAll('script[type=\"application/ld+json\"], script'))) { const t = s.textContent || ''; if (!t.includes(href)) continue; m = t.match(/\"numberOfBedrooms\"\\s*:\\s*\"?(\\d+(?:\\.\\d+)?)\"?/i); if (m) return m[1]; } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "bathroom_s_",
            "selector": "(() => { const parts = [ROW.innerText || '', ROW.textContent || '']; ROW.querySelectorAll('[aria-label],[title]').forEach(e => { parts.push(e.getAttribute('aria-label') || ''); parts.push(e.getAttribute('title') || ''); }); const text = parts.join(' '); let m = text.match(/(\\d+(?:\\.\\d+)?)\\s*(?:ba|bath|baths|bathroom|bathrooms)(?![a-z])/i); if (m) return m[1]; const a = ROW.querySelector('a[href*=\"/homedetails/\"]'); const href = a ? new URL(a.getAttribute('href'), location.origin).href.split('?')[0] : ''; if (!href) return ''; for (const s of Array.from(document.querySelectorAll('script[type=\"application/ld+json\"], script'))) { const t = s.textContent || ''; if (!t.includes(href)) continue; m = t.match(/\"(?:numberOfBathroomsTotal|numberOfBathrooms|bathrooms?|baths?)\"\\s*:\\s*\"?(\\d+(?:\\.\\d+)?)\"?/i); if (m) return m[1]; } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "square_feet",
            "selector": "(() => { const parts = [ROW.innerText || '', ROW.textContent || '']; ROW.querySelectorAll('[aria-label],[title]').forEach(e => { parts.push(e.getAttribute('aria-label') || ''); parts.push(e.getAttribute('title') || ''); }); const text = parts.join(' '); let m = text.match(/([\\d,]+)\\s*(?:sqft|sq ft|square feet)/i); if (m) return m[1].replace(/,/g, ''); const a = ROW.querySelector('a[href*=\"/homedetails/\"]'); const href = a ? new URL(a.getAttribute('href'), location.origin).href.split('?')[0] : ''; if (!href) return ''; for (const s of Array.from(document.querySelectorAll('script[type=\"application/ld+json\"], script'))) { const t = s.textContent || ''; if (!t.includes(href)) continue; m = t.match(/\"floorSize\"\\s*:\\s*\\{[^}]*\"value\"\\s*:\\s*\"?([\\d,]+)\"?/i) || t.match(/\"livingArea\"\\s*:\\s*\"?([\\d,]+)\"?/i); if (m) return m[1].replace(/,/g, ''); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "status",
            "selector": "(() => { const text = [ROW.innerText || '', ROW.textContent || ''].join(' '); if (/sold/i.test(text)) return 'Sold'; if (/pending/i.test(text)) return 'Pending'; if (/for rent|rent/i.test(text)) return 'For rent'; if (/for sale|active|house for sale|condo for sale|townhouse for sale/i.test(text)) return 'Active'; return 'Active'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "address",
            "selector": "(() => { const el = ROW.querySelector('[data-test=property-card-addr], [data-testid=property-card-addr], address'); if (el) return el.innerText.trim(); const a = ROW.querySelector('a[href*=\"/homedetails/\"]'); const aria = a ? (a.getAttribute('aria-label') || a.getAttribute('title') || '') : ''; if (aria) return aria.replace(/^.*?for sale:\\s*/i, '').replace(/^.*?property:\\s*/i, '').replace(/^\\$[\\d,.]+\\s*[KMB]?\\s*/i, '').trim(); const img = ROW.querySelector('img[alt]'); return img ? img.alt.trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "listing_by",
            "selector": "(() => { const el = ROW.querySelector('[data-test=property-card-broker], [data-testid=property-card-broker], .broker-name'); if (el) return el.innerText.trim(); const lines = (ROW.innerText || ROW.textContent || '').split(/\\n+/).map(s => s.trim()).filter(Boolean); const broker = lines.find(s => /listing by|brokered by|MLS|broker|realty|real estate|MLS GRID/i.test(s)); return broker ? broker.replace(/^Listing by\\s*/i, '').replace(/^Brokered by\\s*/i, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2136,
      "position_y": 220,
      "config": {
        "selector": "iframe#px-captcha-modal, iframe[id*=\"captcha\" i], iframe[src*=\"captcha\" i]",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2136,
      "position_y": 520,
      "config": {
        "selector": "a[rel=\"next\"]:not([aria-disabled=\"true\"])",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "inject-javascript-2",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript on the page",
      "position_x": 2640,
      "position_y": 800,
      "config": {
        "jsCode": "(() => { const a = document.querySelector('a[rel=\"next\"]:not([aria-disabled=\"true\"])'); if (!a) return 'no next page'; const href = new URL(a.getAttribute('href'), location.origin).href; window.location.href = href; return 'navigating to ' + href; })()",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 2976,
      "position_y": 800,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3312,
      "position_y": 800,
      "config": {
        "duration": 5,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2472,
      "position_y": 520,
      "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": "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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-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": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "element-exists-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "false",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "true",
      "to_block_id": "inject-javascript-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-2",
      "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": "structured-export-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "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": 384,
      "position_y": 116,
      "width": 3176,
      "height": 876,
      "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": 1056,
      "position_y": 116,
      "width": 1832,
      "height": 876,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1",
          "inject-javascript-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1728,
      "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": 2064,
      "position_y": 116,
      "width": 380,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "element-exists-2"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2400,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Zillow property listing data for keyword Seattle in buy/for-sale mode. Extracts keyword, image URL, property URL, price, beds, baths, square feet, status, address, and listing source. Pagination is implemented as a guarded Next-page loop: the current page is exported first, then the template checks for Zillow CAPTCHA/PerimeterX iframe and ends cleanly if present; otherwise it navigates to a[rel=\"next\"] via JavaScript instead of physical click to reduce click-interception failures. Best-effort only: Zillow may show CAPTCHA, bot checks, cookie prompts, or layout changes; manually solve CAPTCHA in the browser if required.",
      "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: `(() => { const choices = ['accept','agree','allow all','i agree']; const buttons = Array.from(docume...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1328,
      "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": "Structured export with JS columns (keyword, image_url, house_url, price, bedroom_s_). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 200,
      "width": 340,
      "height": 130,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `iframe#px-captcha-modal, iframe[id*=\"captcha\" i], iframe[src*=\"captcha\" i]`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2336,
      "position_y": 200,
      "width": 340,
      "height": 155,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-element-exists-2",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `a[rel=\"next\"]:not([aria-disabled=\"true\"])`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2336,
      "position_y": 500,
      "width": 340,
      "height": 144,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-2"
      }
    },
    {
      "id": "note-block-inject-javascript-2",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(() => { const a = document.querySelector('a[rel=\"next\"]:not([aria-disabled=\"true\"])'); if (!a) retu...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 780,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-2"
      }
    }
  ]
}