{
  "version": "1.0.0",
  "exported_at": "2026-06-01T15:00:00.000Z",
  "project": {
    "name": "Amazon Japan URLs Scraper",
    "description": "Scrapes Amazon Japan product detail pages by ASIN URL and exports ASIN, title, star rating, review count, price, detail URL, and scrape time. Navigation is implemented as a multi-URL ASIN loop using navigate.urls plus loop-continue, with structured-export in append mode so all configured ASIN pages are collected into amazon-japan-urls-scraper.csv. Amazon may show CAPTCHA, regional availability messages, or 404 pages; in those cases some product fields may be blank.",
    "color": "bg-[#ff9900]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 260,
      "config": {
        "urls": [
          "https://www.amazon.co.jp/dp/B07HRF5NXP",
          "https://www.amazon.co.jp/dp/B07B6FZ682",
          "https://www.amazon.co.jp/dp/B07216P8BC",
          "https://www.amazon.co.jp/dp/B071JQYS13",
          "https://www.amazon.co.jp/dp/B07YVCXDJ3",
          "https://www.amazon.co.jp/dp/B00NTCH52W",
          "https://www.amazon.co.jp/dp/B0763VDR5J",
          "https://www.amazon.co.jp/dp/B07VR824DF",
          "https://www.amazon.co.jp/dp/B07VYY3HJH"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "amazon",
          "asin",
          "multi-url"
        ]
      }
    },
    {
      "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": 260,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "selector": "body",
        "timeout": 20,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "amazon-japan-urls-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "tags": [
          "product-details",
          "js-columns"
        ],
        "columns": [
          {
            "name": "ASIN",
            "selector": "(() => { const url = location.href; let m = url.match(/\\/(?:dp|gp\\/product)\\/([A-Z0-9]{10})/i); if (m) return m[1].toUpperCase(); const asin = ROW.querySelector('input#ASIN, input[name=\"ASIN\"]')?.value; if (asin) return asin.toUpperCase(); m = url.match(/[?&](?:keywords|k)=([A-Z0-9]{10})/i); return m ? decodeURIComponent(m[1]).toUpperCase() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Title",
            "selector": "(() => { const el = ROW.querySelector('#productTitle') || ROW.querySelector('h1#title span'); const t = el?.textContent?.trim(); if (t) return t.replace(/\\s+/g, ' '); const mt = document.querySelector('meta[name=\"title\"], meta[property=\"og:title\"]')?.content || document.title; return (mt || '').replace(/^Amazon\\.co\\.jp:\\s*/i, '').replace(/\\s*:\\s*Amazon.*$/i, '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Star_Rating",
            "selector": "(() => { const selectors = ['#acrPopover .a-icon-alt', 'span[data-hook=\"rating-out-of-text\"]', 'i[data-hook=\"average-star-rating\"] .a-icon-alt']; for (const s of selectors) { const t = ROW.querySelector(s)?.textContent?.trim(); if (t) return t.replace(/\\s+/g, ' '); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Number_of_Reviews",
            "selector": "(() => { const t = ROW.querySelector('#acrCustomerReviewText')?.textContent?.trim() || ROW.querySelector('[data-hook=\"total-review-count\"]')?.textContent?.trim() || ''; const m = t.match(/[\\d,\\.]+/); return m ? m[0] : t; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Price",
            "selector": "(() => { const selectors = ['#corePrice_feature_div .a-offscreen', '.priceToPay .a-offscreen', '#priceblock_ourprice', '#priceblock_dealprice', '#priceblock_saleprice', '#apex_desktop .a-offscreen', '.a-price .a-offscreen']; for (const s of selectors) { const t = ROW.querySelector(s)?.textContent?.trim(); if (t) return t.replace(/\\s+/g, ' '); } const m = ROW.textContent.match(/(?:￥|¥)\\s?[\\d,]+/); return m ? m[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Detail_Page_URL",
            "selector": "(() => location.href)()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Current_Time",
            "selector": "(() => { const d = new Date(); const p = n => String(n).padStart(2, '0'); return `${p(d.getMonth() + 1)}-${p(d.getDate())}-${d.getFullYear()} ${p(d.getHours())}:${p(d.getMinutes())}:${p(d.getSeconds())}`; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "color": "bg-[#ff832b]",
        "tags": [
          "continue-asin-url-loop"
        ]
      }
    }
  ],
  "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-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": "structured-export-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "structured-export-1",
      "from_connector_id": "right",
      "to_block_id": "loop-continue-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 156,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1488,
      "position_y": 156,
      "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": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Amazon Japan product detail pages by ASIN URL and exports ASIN, title, star rating, review count, price, detail URL, and scrape time. Navigation is implemented as a multi-URL ASIN loop using navigate.urls plus loop-continue, with structured-export in append mode so all configured ASIN pages are collected into amazon-japan-urls-scraper.csv. Amazon may show CAPTCHA, regional availability messages, or 404 pages; in those cases some product fields may be blank.",
      "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 9 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 320,
      "position_y": 240,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (ASIN, Title, Star_Rating, Number_of_Reviews, Price). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 240,
      "width": 340,
      "height": 130,
      "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": 2120,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}