{
  "version": "1.0.0",
  "exported_at": "2026-06-02T12:40:00.000Z",
  "project": {
    "name": "Naver Cafe SERP Scraper",
    "description": "Best-effort Naver Cafe SERP scraper for latest Cafe search results for keyword '모동숲'. Extracts keyword, title, title URL, content/snippet, source cafe/author, source URL, publication time, image URL, and extraction time. Uses known Naver Search Cafe-tab result page URLs with start offsets 1-91 and loop-continue pagination, appending all pages to one CSV. Uses XPath row filtering to include only SERP rows containing cafe.naver.com links, avoiding blank non-result modules. Naver may require manual CAPTCHA/login handling.",
    "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://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=1",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=11",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=21",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=31",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=41",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=51",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=61",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=71",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=81",
          "https://search.naver.com/search.naver?ssc=tab.cafe.all&query=%EB%AA%A8%EB%8F%99%EC%88%B2&sm=tab_opt&sort=1&start=91"
        ],
        "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": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "selector": "//div[@id='main_pack']//li[contains(concat(' ', normalize-space(@class), ' '), ' bx ')][.//a[contains(@href, 'cafe.naver.com')]]",
        "timeout": 45,
        "visible": false,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "rowSelector": "//div[@id='main_pack']//li[contains(concat(' ', normalize-space(@class), ' '), ' bx ')][.//a[contains(@href, 'cafe.naver.com')]]",
        "fileName": "naver-cafe-serp-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "keyword",
            "selector": "(() => { return new URL(location.href).searchParams.get('query') || '모동숲'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "(() => { const cafeLinks = Array.from(ROW.querySelectorAll('a[href*=\"cafe.naver.com\"]')).filter(a => a.textContent.trim()); const preferred = ROW.querySelector('a.title_link, a.api_txt_lines.total_tit, a.link_tit, a.total_tit, a[class*=\"title\"], a[class*=\"tit\"]'); const el = preferred && preferred.href && preferred.href.includes('cafe.naver.com') ? preferred : cafeLinks[0]; return el ? el.textContent.trim().replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title_link_url",
            "selector": "(() => { const cafeLinks = Array.from(ROW.querySelectorAll('a[href*=\"cafe.naver.com\"]')).filter(a => a.href); const preferred = ROW.querySelector('a.title_link, a.api_txt_lines.total_tit, a.link_tit, a.total_tit, a[class*=\"title\"], a[class*=\"tit\"]'); const el = preferred && preferred.href && preferred.href.includes('cafe.naver.com') ? preferred : cafeLinks.find(a => !/\\/CafeHome|section\\.cafe/.test(a.href)) || cafeLinks[0]; return el ? el.href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "content",
            "selector": "(() => { const el = ROW.querySelector('a.dsc_link, .api_txt_lines.dsc_txt, .dsc_txt, .total_dsc, .desc, [class*=\"dsc\"], [class*=\"contents\"], [class*=\"content\"]'); return el ? el.textContent.trim().replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "author",
            "selector": "(() => { const title = ROW.querySelector('a.title_link, a.api_txt_lines.total_tit, a.link_tit, a.total_tit, a[class*=\"title\"], a[class*=\"tit\"]'); const cafeLinks = Array.from(ROW.querySelectorAll('a[href*=\"cafe.naver.com\"]')).filter(a => a.textContent.trim()); const sourceSelectors = ['.user_info a.name', 'a.name', '.source_box a', '.sub_area a', 'a.sub_txt', '.source a', '.total_source a']; for (const sel of sourceSelectors) { const el = ROW.querySelector(sel); if (el && el.textContent.trim() && el !== title) return el.textContent.trim().replace(/\\s+/g, ' '); } const sourceLink = cafeLinks.find(a => a !== title && /cafe\\.naver\\.com\\/[A-Za-z0-9_-]+\\/?([?#].*)?$/.test(a.href)) || cafeLinks[cafeLinks.length - 1]; return sourceLink ? sourceLink.textContent.trim().replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "author_link_url",
            "selector": "(() => { const title = ROW.querySelector('a.title_link, a.api_txt_lines.total_tit, a.link_tit, a.total_tit, a[class*=\"title\"], a[class*=\"tit\"]'); const cafeLinks = Array.from(ROW.querySelectorAll('a[href*=\"cafe.naver.com\"]')).filter(a => a.href); const sourceSelectors = ['.user_info a.name', 'a.name', '.source_box a', '.sub_area a', 'a.sub_txt', '.source a', '.total_source a']; for (const sel of sourceSelectors) { const el = ROW.querySelector(sel); if (el && el.href && el !== title) return el.href; } const sourceLink = cafeLinks.find(a => a !== title && /cafe\\.naver\\.com\\/[A-Za-z0-9_-]+\\/?([?#].*)?$/.test(a.href)) || cafeLinks[cafeLinks.length - 1]; return sourceLink ? sourceLink.href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "publication_time",
            "selector": "(() => { const candidates = Array.from(ROW.querySelectorAll('.sub_time, .date, .time, span[class*=\"time\"], span[class*=\"date\"], .source_box span, .sub_area span, .total_source span')); const found = candidates.map(e => e.textContent.trim()).find(t => /\\d+\\s*(초|분|시간|일|주|개월|년)\\s*전|\\d{4}\\.\\d{1,2}\\.\\d{1,2}|\\d{4}-\\d{1,2}-\\d{1,2}/.test(t)); if (found) { const m1 = found.match(/\\d+\\s*(초|분|시간|일|주|개월|년)\\s*전|\\d{4}\\.\\d{1,2}\\.\\d{1,2}|\\d{4}-\\d{1,2}-\\d{1,2}/); return m1 ? m1[0] : found; } const txt = ROW.textContent.trim(); const m = txt.match(/\\d+\\s*(초|분|시간|일|주|개월|년)\\s*전|\\d{4}\\.\\d{1,2}\\.\\d{1,2}|\\d{4}-\\d{1,2}-\\d{1,2}/); return m ? m[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image",
            "selector": "(() => { const el = ROW.querySelector('img[src*=\"cafeptthumb\"], a.thumb img, .thumb img, img[src*=\"pstatic.net\"]'); return el ? el.src : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "extraction_time",
            "selector": "(() => { return new Date().toISOString(); })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "duration": 1,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2640,
      "position_y": 240,
      "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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-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": "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": 2120,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 136,
      "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": 2568,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort Naver Cafe SERP scraper for latest Cafe search results for keyword '모동숲'. Extracts keyword, title, title URL, content/snippet, source cafe/author, source URL, publication time, image URL, and extraction time. Uses known Naver Search Cafe-tab result page URLs with start offsets 1-91 and loop-continue pagination, appending all pages to one CSV. Uses XPath row filtering to include only SERP rows containing cafe.naver.com links, avoiding blank non-result modules. Naver may require manual CAPTCHA/login handling.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-navigate-1",
      "element_type": "note",
      "title": "Note: Navigate",
      "content": "Multi-URL loop over 10 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "position_y": 220,
      "width": 332,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-wait-for-element-1",
      "element_type": "note",
      "title": "Note: Wait for Element",
      "content": "Uses XPath `//div[@id='main_pack']//li[contains(concat(' ', normalize-space(@class), ' '), ' bx ')][.//a[contain`. XPath breaks easily if DOM structure changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 220,
      "width": 340,
      "height": 133,
      "z_index": 22,
      "data": {
        "block_id": "wait-for-element-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (keyword, title, title_link_url, content, author). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 220,
      "width": 340,
      "height": 129,
      "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": 2840,
      "position_y": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}