{
  "version": "1.0.0",
  "exported_at": "2026-06-03T01:50:00.000Z",
  "project": {
    "name": "Surugaya Item List Search",
    "description": "Best-effort Surugaya keyword search result scraper equivalent to the Octoparse template. Extracts category, title, title URL, image URL, condition/type, release date, publisher, list price, used price, new price, preorder price, and other shop availability from product listing results. Uses product-detail links as result rows and follows enabled Next pagination, appending all pages to one CSV. Autonomous testing confirmed Surugaya returns Cloudflare/security verification in the automated browser session; if no product links appear, the template detects the blocked/no-results state and exits. Use a warmed browser profile, manual verification, proxy, or trusted network session before running.",
    "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
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 456,
      "position_y": 220,
      "config": {
        "url": "https://www.suruga-ya.jp/search?category=&search_word=%E9%AC%BC%E6%BB%85%E3%81%AE%E5%88%83",
        "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": 792,
      "position_y": 220,
      "config": {
        "timeout": 60
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "duration": 20
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1800,
      "position_y": 220,
      "config": {
        "selector": "a[href*='/product/detail/']"
      }
    },
    {
      "block_id": "text-contains-1",
      "block_type": "process",
      "title": "Text Contains",
      "description": "Check if page contains text",
      "position_x": 1800,
      "position_y": 520,
      "config": {
        "selector": "body",
        "text": "security verification",
        "caseSensitive": false
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2472,
      "position_y": 520,
      "config": {}
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2136,
      "position_y": 520,
      "config": {
        "rowSelector": "a[href*='/product/detail/']",
        "fileName": "surugaya-item-list-search.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "category",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW; const el = card.querySelector('.category,[class*=\"category\"]') || document.querySelector('.breadcrumb li:last-child, nav.breadcrumb li:last-child, select[name=\"category\"] option:checked'); return el ? el.textContent.trim().replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "(() => ROW.textContent.trim().replace(/\\s+/g, ' '))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title_url",
            "selector": "(() => ROW.href || '')()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const img = card.querySelector('img'); let u = img ? (img.getAttribute('data-src') || img.getAttribute('data-original') || img.getAttribute('data-lazy') || img.getAttribute('src') || '') : ''; if (u && !/^https?:/i.test(u)) u = new URL(u, location.href).href; if (u) return u; const m = ROW.href.match(/detail\\/(\\d+)/); return m ? 'https://www.suruga-ya.jp/database/photo.php?shinaban=' + m[1] + '&size=m' : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "condition",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const el = card.querySelector('.condition,[class*=\"condition\"],[class*=\"janru\"],[class*=\"genre\"]'); if (el) return el.textContent.trim().replace(/\\s+/g, ' '); const lines = card.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const title = ROW.textContent.trim().replace(/\\s+/g, ' '); const dateIndex = lines.findIndex(s => /^\\d{4}\\/\\d{1,2}\\/\\d{1,2}$/.test(s)); if (dateIndex > 0) return lines[dateIndex - 1] === title && dateIndex > 1 ? lines[dateIndex - 2] : lines[dateIndex - 1]; return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "release_date",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const t = card.innerText.replace(/\\s+/g, ' '); const m = t.match(/\\d{4}\\/\\d{1,2}\\/\\d{1,2}/); return m ? m[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "publisher",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const el = card.querySelector('.maker,.publisher,.brand,[class*=\"maker\"],[class*=\"publisher\"],[class*=\"brand\"]'); if (el) return el.textContent.trim().replace(/\\s+/g, ' '); const lines = card.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const i = lines.findIndex(s => /^\\d{4}\\/\\d{1,2}\\/\\d{1,2}$/.test(s)); return i >= 0 && lines[i + 1] ? lines[i + 1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "list_price_tax_included",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const t = card.innerText.replace(/\\s+/g, ' '); const m = t.match(/(?:定価|参考価格|メーカー希望小売価格)[:：]?\\s*([0-9,]+\\s*円?|[0-9,]+)/); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "used_price_tax_included",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const el = card.querySelector('.used,.price-used,[class*=\"used\"]'); if (el) return el.textContent.trim().replace(/\\s+/g, ' '); const t = card.innerText.replace(/\\s+/g, ' '); const m = t.match(/(?:中古(?:品)?(?:価格)?|中古)[:：]?\\s*([0-9,]+\\s*円?|[0-9,]+)/); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "new_price_tax_included",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const el = card.querySelector('.new,.price-new,[class*=\"new\"]'); if (el) return el.textContent.trim().replace(/\\s+/g, ' '); const t = card.innerText.replace(/\\s+/g, ' '); const m = t.match(/(?:新品(?:価格)?|新品)[:：]?\\s*([0-9,]+\\s*円?|[0-9,]+)/); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "preorder_price_tax_included",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const el = card.querySelector('.reserve,.preorder,.price-reserve,[class*=\"reserve\"],[class*=\"preorder\"]'); if (el) return el.textContent.trim().replace(/\\s+/g, ' '); const t = card.innerText.replace(/\\s+/g, ' '); const m = t.match(/(?:予約(?:価格)?|予約)[:：]?\\s*([0-9,]+\\s*円?|[0-9,]+)/); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "other_shops",
            "selector": "(() => { const card = ROW.closest('li, article, .item, .item_box, .item-box, .product-item, .search-result-item, div') || ROW.parentElement || ROW; const el = card.querySelector('.other-shop,.other_shops,.shops,[class*=\"other\"],[class*=\"shop\"]'); if (el) return el.textContent.trim().replace(/\\s+/g, ' '); const lines = card.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const hit = lines.find(s => /[0-9０-９]+点の/.test(s)); return hit || ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2472,
      "position_y": 520,
      "config": {
        "selector": "//a[(contains(normalize-space(.),'次') or contains(normalize-space(.),'＞') or contains(normalize-space(.),'›') or contains(normalize-space(.),'»') or @rel='next') and not(ancestor::*[contains(@class,'disabled')]) and not(contains(@class,'disabled'))]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 2808,
      "position_y": 520,
      "config": {
        "selector": "//a[(contains(normalize-space(.),'次') or contains(normalize-space(.),'＞') or contains(normalize-space(.),'›') or contains(normalize-space(.),'»') or @rel='next') and not(ancestor::*[contains(@class,'disabled')]) and not(contains(@class,'disabled'))]",
        "timeout": 15
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 3144,
      "position_y": 520,
      "config": {
        "timeout": 60
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3480,
      "position_y": 520,
      "config": {
        "duration": 5
      }
    }
  ],
  "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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "text-contains-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "text-contains-1",
      "from_connector_id": "true",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "text-contains-1",
      "from_connector_id": "false",
      "to_block_id": "end-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "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": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-1",
      "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": "element-exists-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": 3344,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "wait-for-page-load-2",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1728,
      "position_y": 116,
      "width": 1328,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "text-contains-1",
          "element-exists-2",
          "click-1"
        ]
      }
    },
    {
      "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": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2064,
      "position_y": 416,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort Surugaya keyword search result scraper equivalent to the Octoparse template. Extracts category, title, title URL, image URL, condition/type, release date, publisher, list price, used price, new price, preorder price, and other shop availability from product listing results. Uses product-detail links as result rows and follows enabled Next pagination, appending all pages to one CSV. Autonomous testing confirmed Surugaya returns Cloudflare/security verification in the automated browser session; if no product links appear, the template detects the blocked/no-results state and exits. Use a warmed browser profile, manual verification, proxy, or trusted network session before running.",
      "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 `a[href*='/product/detail/']`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 200,
      "width": 340,
      "height": 139,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-text-contains-1",
      "element_type": "note",
      "title": "Note: Text Contains",
      "content": "Condition block: checks `body`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 500,
      "width": 340,
      "height": 131,
      "z_index": 22,
      "data": {
        "block_id": "text-contains-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (category, title, title_url, image_url, condition). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2336,
      "position_y": 500,
      "width": 340,
      "height": 130,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-2",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `//a[(contains(normalize-space(.),'次') or contains(normalize-space(.),'＞') or contains(normalize-space(.),'›') or contain`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2672,
      "position_y": 500,
      "width": 340,
      "height": 170,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-2"
      }
    },
    {
      "id": "note-block-click-1",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Uses XPath `//a[(contains(normalize-space(.),'次') or contains(normalize-space(.),'＞') or contains(normalize-spac`. XPath breaks easily if DOM structure changes.",
      "color": "#ee5396",
      "position_x": 3008,
      "position_y": 500,
      "width": 340,
      "height": 133,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    }
  ]
}