{
  "version": "1.0.0",
  "exported_at": "2026-06-02T20:20:00.000Z",
  "project": {
    "name": "AOL Search Result Scraper",
    "description": "Scrapes AOL Search results by keyword from the AOL video/search results layout observed in the Page Analysis. Starts with keyword 'Sustainable living' and exports keyword, title, link, and description-like metadata to CSV. Pagination is handled best-effort: after each extraction the template scrolls down, checks for a visible enabled AOL Next button, clicks it when visible, and appends subsequent result pages. Hidden AOL next controls are ignored to avoid click failures. Add more AOL search URLs to navigate.urls to scrape additional keywords. AOL may occasionally show consent, regional, or anti-bot pages.",
    "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": 220,
      "config": {
        "urls": [
          "https://search.aol.com/aol/video?q=Sustainable+living&v_t=na"
        ],
        "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": 220,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Allow AOL dynamic search results to render",
      "position_x": 840,
      "position_y": 220,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until AOL video result headings appear",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "selector": ".srp-content h3, section#search h3, li.vr h3",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export AOL result data with custom columns",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "rowSelector": ".srp-content li.vr.vres, section#search li.vr.vres, li.vr.vres",
        "fileName": "aol-search-result-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "keyword",
            "selector": "(() => { const q = new URLSearchParams(window.location.search).get('q'); return q ? q.replace(/\\+/g, ' ') : 'Sustainable living'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "(() => { const h = ROW.querySelector('h3'); let t = (h?.textContent || '').trim(); if (!t) { const aria = ROW.querySelector('a.ng[aria-label], a[aria-label]')?.getAttribute('aria-label') || ''; t = aria.split('. Length:')[0].trim(); } return t; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "link",
            "selector": "(() => { const a = ROW.querySelector('a.ng[data-rurl], a[data-rurl], a.ng[href], a[href]'); if (!a) return ''; const direct = a.getAttribute('data-rurl'); if (direct) return direct; const href = a.href || a.getAttribute('href') || ''; const marker = '/RU='; const i = href.indexOf(marker); if (i >= 0) { const encoded = href.slice(i + marker.length).split('/')[0]; try { return decodeURIComponent(encoded); } catch (e) { return encoded; } } try { const u = new URL(href); const ru = u.searchParams.get('RU') || u.searchParams.get('rurl') || u.searchParams.get('url'); if (ru) return decodeURIComponent(ru); } catch (e) {} return href; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "description",
            "selector": "(() => { const length = (ROW.querySelector('.v-time')?.textContent || '').trim(); const age = (ROW.querySelector('.v-age')?.textContent || '').trim(); const source = (ROW.querySelector('cite.url')?.textContent || '').trim(); const aria = ROW.querySelector('a.ng[aria-label], a[aria-label]')?.getAttribute('aria-label') || ''; const parts = []; if (length) parts.push('Length: ' + length); if (age) parts.push(age); if (source) parts.push('Source: ' + source); if (parts.length) return parts.join(' | '); return aria.trim(); })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "scroll-1",
      "block_type": "process",
      "title": "Scroll",
      "description": "Scroll down to pagination area",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "direction": "down",
        "amount": 2500
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Allow pagination controls to settle after scrolling",
      "position_x": 2280,
      "position_y": 220,
      "config": {
        "duration": 1
      }
    },
    {
      "block_id": "element-visible-1",
      "block_type": "process",
      "title": "Element Visible",
      "description": "Check if an enabled AOL Next pagination button is visible",
      "position_x": 2640,
      "position_y": 220,
      "config": {
        "selector": "button.next[aria-label=\"Next\"]:not(:disabled)"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click AOL's visible Next pagination button",
      "position_x": 3000,
      "position_y": 220,
      "config": {
        "selector": "button.next[aria-label=\"Next\"]:not(:disabled)",
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-3",
      "block_type": "process",
      "title": "Sleep",
      "description": "Allow next AOL result page to render",
      "position_x": 3360,
      "position_y": 220,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until next-page AOL result headings appear",
      "position_x": 3360,
      "position_y": 540,
      "config": {
        "selector": ".srp-content h3, section#search h3, li.vr h3",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input keyword URL loop",
      "position_x": 2640,
      "position_y": 860,
      "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": "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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "scroll-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "scroll-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": "element-visible-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-visible-1",
      "from_connector_id": "true",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-visible-1",
      "from_connector_id": "false",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-1",
      "from_connector_id": "right",
      "to_block_id": "sleep-3",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-3",
      "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"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 116,
      "width": 3560,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "sleep-2",
          "sleep-3",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1488,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1848,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "scroll-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 2568,
      "position_y": 116,
      "width": 680,
      "height": 936,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-visible-1",
          "click-1",
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes AOL Search results by keyword from the AOL video/search results layout observed in the Page Analysis. Starts with keyword 'Sustainable living' and exports keyword, title, link, and description-like metadata to CSV. Pagination is handled best-effort: after each extraction the template scrolls down, checks for a visible enabled AOL Next button, clicks it when visible, and appends subsequent result pages. Hidden AOL next controls are ignored to avoid click failures. Add more AOL search URLs to navigate.urls to scrape additional keywords. AOL may occasionally show consent, regional, or anti-bot pages.",
      "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 (keyword, title, link, description). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 200,
      "width": 340,
      "height": 125,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-visible-1",
      "element_type": "note",
      "title": "Note: Element Visible",
      "content": "Condition block: checks `button.next[aria-label=\"Next\"]:not(:disabled)`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 200,
      "width": 340,
      "height": 145,
      "z_index": 22,
      "data": {
        "block_id": "element-visible-1"
      }
    },
    {
      "id": "note-block-click-1",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Pagination click — add waits after this block; the page reloads asynchronously.",
      "color": "#ee5396",
      "position_x": 3200,
      "position_y": 200,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-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": 2840,
      "position_y": 840,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}