{
  "version": "1.0.0",
  "exported_at": "2026-06-02T13:32:00.000Z",
  "project": {
    "name": "Naver Cafe Scraper",
    "description": "Scrapes public Naver Cafe search results for the sample keyword \"승리의 여신: 니케\" from Naver Search's Cafe tab. Extracts keyword, title, title URL, content snippet, author/source cafe, source URL, publication time, image URL, and extraction time. Pagination uses a visible Next-button loop and appends each page to naver_cafe_scraper.csv when Naver exposes a usable Next link; in the test environment the visible next-page selector was not present, so the template safely ends after the current result page. Naver may show CAPTCHA, rate-limit, or require manual verification/login; pause and solve manually if blocked.",
    "color": "bg-[#42be65]",
    "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": 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": 480,
      "position_y": 220,
      "config": {
        "url": "https://search.naver.com/search.naver?ssc=tab.cafe.all&sm=tab_jum&query=%EC%8A%B9%EB%A6%AC%EC%9D%98%20%EC%97%AC%EC%8B%A0%3A%20%EB%8B%88%EC%BC%80",
        "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": 220,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "selector": "a.title_link[href*=\"cafe.naver.com\"], a.total_tit[href*=\"cafe.naver.com\"], a[href*=\"cafe.naver.com\"][href*=\"ArticleRead\"], a[href*=\"cafe.naver.com\"][href*=\"/articles/\"]",
        "timeout": 40,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "rowSelector": "a.title_link[href*=\"cafe.naver.com\"], a.total_tit[href*=\"cafe.naver.com\"], a[href*=\"cafe.naver.com\"][href*=\"ArticleRead\"], a[href*=\"cafe.naver.com\"][href*=\"/articles/\"]",
        "fileName": "naver_cafe_scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "keyword",
            "selector": "\"승리의 여신: 니케\"",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "",
            "attribute": "text"
          },
          {
            "name": "title_url",
            "selector": "",
            "attribute": "href"
          },
          {
            "name": "content",
            "selector": "(() => { const titleText = ROW.textContent.replace(/\\s+/g, ' ').trim(); const card = ROW.closest('li, div.total_wrap, div.view_wrap, div.bx, div[class*=fds], div[class*=item], section, article') || ROW.parentElement || ROW; const candidates = Array.from(card.querySelectorAll('.total_dsc, .api_txt_lines, .dsc_txt, .desc, .description, .title_area + div, p, span')).map(e => e.textContent.replace(/\\s+/g, ' ').trim()).filter(t => t.length > 20 && t !== titleText && !/^카페$|^블로그$|^이미지$/.test(t)); if (candidates.length) return candidates[0]; return card.textContent.replace(/\\s+/g, ' ').trim().replace(titleText, '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "author",
            "selector": "(() => { const titleText = ROW.textContent.replace(/\\s+/g, ' ').trim(); const card = ROW.closest('li, div.total_wrap, div.view_wrap, div.bx, div[class*=fds], div[class*=item], section, article') || ROW.parentElement || ROW; const candidates = Array.from(card.querySelectorAll('.sub_txt, .source_txt, .source_box a, .total_source, .name, .user_info a, .fds-info-inner-text, a[href*=\\\"cafe.naver.com\\\"]')).map(e => e.textContent.replace(/\\s+/g, ' ').trim()).filter(t => t && t !== titleText && !/^카페$|^블로그$|^이미지$/.test(t)); return candidates[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "author_url",
            "selector": "(() => { const card = ROW.closest('li, div.total_wrap, div.view_wrap, div.bx, div[class*=fds], div[class*=item], section, article') || ROW.parentElement || ROW; const links = Array.from(card.querySelectorAll('a[href*=\\\"cafe.naver.com\\\"]')).filter(a => a.href !== ROW.href && !/ArticleRead|\\/articles\\//.test(a.href)); return links[0] ? links[0].href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "publication_time",
            "selector": "(() => { const card = ROW.closest('li, div.total_wrap, div.view_wrap, div.bx, div[class*=fds], div[class*=item], section, article') || ROW.parentElement || ROW; const el = card.querySelector('time, .sub_time, .date, .txt_date, .fds-info-sub-inner-text'); if (el) return el.textContent.replace(/\\s+/g, ' ').trim(); const text = card.textContent.replace(/\\s+/g, ' '); const m = text.match(/\\d{4}\\.\\d{2}\\.\\d{2}\\.?|\\d{4}-\\d{2}-\\d{2}|\\d+\\s*(분|시간|일|주|개월|년)\\s*전/); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image",
            "selector": "(() => { const card = ROW.closest('li, div.total_wrap, div.view_wrap, div.bx, div[class*=fds], div[class*=item], section, article') || ROW.parentElement || ROW; const img = Array.from(card.querySelectorAll('img[src]')).filter(i => !/hidden\\.gif|sp_|icon|blank|data:image/.test(i.src))[0]; return img ? img.src : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "extraction_time",
            "selector": "new Date().toISOString()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-visible-1",
      "block_type": "process",
      "title": "Element Visible",
      "description": "Check if element is visible",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "selector": "a.btn_next[href*=\"start=\"], a.api_next[href*=\"start=\"], .sc_page a.btn_next[href], .api_sc_page_wrap a.btn_next[href]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1920,
      "position_y": 540,
      "config": {
        "selector": "a.btn_next[href*=\"start=\"], a.api_next[href*=\"start=\"], .sc_page a.btn_next[href], .api_sc_page_wrap a.btn_next[href]",
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2280,
      "position_y": 540,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 2640,
      "position_y": 540,
      "config": {
        "selector": "a.title_link[href*=\"cafe.naver.com\"], a.total_tit[href*=\"cafe.naver.com\"], a[href*=\"cafe.naver.com\"][href*=\"ArticleRead\"], a[href*=\"cafe.naver.com\"][href*=\"/articles/\"]",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 1920,
      "position_y": 860,
      "config": {}
    }
  ],
  "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": "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": "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": "end-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-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-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": 408,
      "position_y": 116,
      "width": 2480,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1",
          "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-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1848,
      "position_y": 116,
      "width": 380,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-visible-1",
          "click-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 1848,
      "position_y": 756,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes public Naver Cafe search results for the sample keyword \"승리의 여신: 니케\" from Naver Search's Cafe tab. Extracts keyword, title, title URL, content snippet, author/source cafe, source URL, publication time, image URL, and extraction time. Pagination uses a visible Next-button loop and appends each page to naver_cafe_scraper.csv when Naver exposes a usable Next link; in the test environment the visible next-page selector was not present, so the template safely ends after the current result page. Naver may show CAPTCHA, rate-limit, or require manual verification/login; pause and solve manually if blocked.",
      "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, content, author, author_url, publication_time). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 200,
      "width": 340,
      "height": 132,
      "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 `a.btn_next[href*=\"start=\"], a.api_next[href*=\"start=\"], .sc_page a.btn_next[href], .api_sc_page_wrap a.btn_next[href]`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 200,
      "width": 340,
      "height": 169,
      "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": 2120,
      "position_y": 520,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    }
  ]
}