{
  "version": "1.0.0",
  "exported_at": "2026-06-03T00:00:00.000Z",
  "project": {
    "name": "Bic Camera Search Results Scraper",
    "description": "Scrapes Bic Camera keyword search results from www.biccamera.com. The default URL uses the Japanese keyword カメラ; edit the q= query value for another keyword. Extracts product name, price, points, product URL, image URL, availability, product code, and result page URL. Pagination is handled with a click-next loop until no enabled Next/次 link exists. Product waits use existence rather than visibility because Bic Camera result links/images may be lazy-loaded or hidden until layout scripts complete.",
    "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": 240,
      "config": {
        "url": "https://www.biccamera.com/bc/category/?q=%E3%82%AB%E3%83%A1%E3%83%A9",
        "color": "bg-[#4589ff]",
        "tags": [
          "bic-camera",
          "search-results"
        ]
      }
    },
    {
      "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": 240,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 840,
      "position_y": 240,
      "config": {
        "duration": 3
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "selector": "a[href*='/bc/item/']",
        "timeout": 45,
        "visible": false
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "rowSelector": "a[href*='/bc/item/']",
        "fileName": "Bic-Camera-Search-Results-Scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "product_name",
            "selector": "(() => { const a = ROW; const root = a.closest('li') || a.closest('[data-item-code], [data-code], [class*=\"item\"], [class*=\"Item\"], [class*=\"prod\"], [class*=\"Prod\"]') || a.parentElement || a; const nameEl = root.querySelector('.bcs_itemName a, .prod_name a, .product-name a, .itemName a, h2 a, h3 a, a[href*=\"/bc/item/\"]') || a; const img = root.querySelector('img'); const v = (nameEl && nameEl.textContent.trim()) || (a && a.textContent.trim()) || (img && (img.getAttribute('alt') || img.getAttribute('title'))) || ''; return v.trim().replace(/\\s+/g, ' '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const a = ROW; const root = a.closest('li') || a.closest('[data-item-code], [data-code], [class*=\"item\"], [class*=\"Item\"], [class*=\"prod\"], [class*=\"Prod\"]') || a.parentElement || a; const el = root.querySelector('.bcs_price, .prod_price, .productPrice, .price, [class*=\"price\"], [class*=\"Price\"]'); if (el) return el.textContent.trim().replace(/\\s+/g, ' '); const text = root.textContent || ''; const m = text.match(/(?:税込)?\\s*[¥￥]\\s*[0-9,]+|[0-9,]+\\s*円/); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "points",
            "selector": "(() => { const a = ROW; const root = a.closest('li') || a.closest('[data-item-code], [data-code], [class*=\"item\"], [class*=\"Item\"], [class*=\"prod\"], [class*=\"Prod\"]') || a.parentElement || a; const el = root.querySelector('.bcs_point, .prod_point, .point, [class*=\"point\"], [class*=\"Point\"]'); if (el) return el.textContent.trim().replace(/\\s+/g, ' '); const text = root.textContent || ''; const m = text.match(/[0-9,]+\\s*(?:ポイント|pt|P)/i); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_url",
            "selector": "(() => { const href = ROW.getAttribute('href') || ''; return href ? new URL(href, location.href).href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url",
            "selector": "(() => { const a = ROW; const root = a.closest('li') || a.closest('[data-item-code], [data-code], [class*=\"item\"], [class*=\"Item\"], [class*=\"prod\"], [class*=\"Prod\"]') || a.parentElement || a; const img = root.querySelector('img'); if (!img) return ''; const src = img.getAttribute('data-src') || img.getAttribute('data-original') || img.getAttribute('data-lazy') || img.getAttribute('src') || ''; return src ? new URL(src, location.href).href : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "availability",
            "selector": "(() => { const a = ROW; const root = a.closest('li') || a.closest('[data-item-code], [data-code], [class*=\"item\"], [class*=\"Item\"], [class*=\"prod\"], [class*=\"Prod\"]') || a.parentElement || a; const el = root.querySelector('.stock, .zaiko, .delivery, .status, .bcs_stock, .bcs_delivery, [class*=\"stock\"], [class*=\"Stock\"], [class*=\"zaiko\"], [class*=\"delivery\"], [class*=\"Delivery\"]'); return el ? el.textContent.trim().replace(/\\s+/g, ' ') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_code",
            "selector": "(() => { const a = ROW; const root = a.closest('li') || a.closest('[data-item-code], [data-code], [class*=\"item\"], [class*=\"Item\"], [class*=\"prod\"], [class*=\"Prod\"]') || a.parentElement || a; const direct = root.getAttribute('data-item-code') || root.getAttribute('data-product-code') || root.getAttribute('data-code') || root.getAttribute('data-jan') || ''; if (direct) return direct; const href = a.getAttribute('href') || ''; const m = href.match(/\\/bc\\/item\\/([^/?#]+)/); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "result_page_url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "selector": "//a[(contains(normalize-space(.), '次') or contains(normalize-space(.), '次へ') or contains(@aria-label, '次') or contains(@title, '次') or @rel='next' or contains(@class, 'next')) and not(contains(@class, 'disabled')) and not(contains(@class, 'off')) and not(contains(@class, 'current')) and not(ancestor::*[contains(@class, 'disabled') or contains(@class, 'off')])]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 2280,
      "position_y": 560,
      "config": {
        "selector": "//a[(contains(normalize-space(.), '次') or contains(normalize-space(.), '次へ') or contains(@aria-label, '次') or contains(@title, '次') or @rel='next' or contains(@class, 'next')) and not(contains(@class, 'disabled')) and not(contains(@class, 'off')) and not(contains(@class, 'current')) and not(ancestor::*[contains(@class, 'disabled') or contains(@class, 'off')])]",
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 2640,
      "position_y": 560,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3000,
      "position_y": 560,
      "config": {
        "duration": 3
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 3360,
      "position_y": 560,
      "config": {
        "selector": "a[href*='/bc/item/']",
        "timeout": 45,
        "visible": false
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 1920,
      "position_y": 880,
      "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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-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": "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": "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": 136,
      "width": 3560,
      "height": 616,
      "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",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1488,
      "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": 1848,
      "position_y": 136,
      "width": 680,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 1848,
      "position_y": 776,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Bic Camera keyword search results from www.biccamera.com. The default URL uses the Japanese keyword カメラ; edit the q= query value for another keyword. Extracts product name, price, points, product URL, image URL, availability, product code, and result page URL. Pagination is handled with a click-next loop until no enabled Next/次 link exists. Product waits use existence rather than visibility because Bic Camera result links/images may be lazy-loaded or hidden until layout scripts complete.",
      "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 (product_name, price, points, product_url, image_url). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 220,
      "width": 340,
      "height": 131,
      "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 `//a[(contains(normalize-space(.), '次') or contains(normalize-space(.), '次へ') or contains(@aria-label, '次') or contains(@`. 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": 220,
      "width": 340,
      "height": 170,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-click-1",
      "element_type": "note",
      "title": "Note: Click",
      "content": "Uses XPath `//a[(contains(normalize-space(.), '次') or contains(normalize-space(.), '次へ') or contains(@aria-label`. XPath breaks easily if DOM structure changes.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 540,
      "width": 340,
      "height": 133,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    }
  ]
}