{
  "version": "1.0.0",
  "exported_at": "2026-06-01T04:55:00.000Z",
  "project": {
    "name": "Amazon Japan Product Listings Scraper",
    "description": "Best-effort Amazon.co.jp keyword product listing scraper equivalent to the Octoparse template. Starts from an Amazon Japan search URL for keyword 'kindle', extracts listing fields such as site, delivery destination, keyword, page number, product name, sponsored flag, product URL, ASIN, rating/ranking text, review count, review URL, price, previous price, and image URL. Pagination is implemented with a click-next loop and CSV append mode so all reachable search-result pages are collected until Amazon disables/removes the Next link. Product and review URLs are generated from ASIN when Amazon listing links are inconsistent. Amazon may show CAPTCHA, anti-bot checks, geo/location prompts, or layout variations; manually solve CAPTCHA or set postal code/location in the browser profile if required.",
    "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": 220,
      "config": {
        "url": "https://www.amazon.co.jp/s?k=kindle&language=en_US",
        "color": "bg-[#4589ff]",
        "tags": [
          "amazon",
          "search",
          "entry"
        ]
      }
    },
    {
      "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": 220,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 840,
      "position_y": 220,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "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": "div.s-main-slot div[data-component-type=\"s-search-result\"][data-asin]:not([data-asin=\"\"])",
        "timeout": 45,
        "visible": true,
        "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": 220,
      "config": {
        "rowSelector": "div.s-main-slot div[data-component-type=\"s-search-result\"][data-asin]:not([data-asin=\"\"])",
        "fileName": "amazon_jp_product_listings_scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "tags": [
          "products",
          "amazon-jp",
          "csv"
        ],
        "columns": [
          {
            "name": "site",
            "selector": "location.hostname.replace(/^www\\./, '') || 'amazon.co.jp'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "delivery_destination",
            "selector": "(() => { const txt = document.querySelector('#glow-ingress-line2')?.textContent || document.querySelector('#nav-global-location-popover-link')?.innerText || document.querySelector('#contextualIngressPtLabel_deliveryShortLine')?.innerText || ''; return txt.replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "keyword",
            "selector": "new URLSearchParams(location.search).get('k') || new URLSearchParams(location.search).get('keywords') || 'kindle'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "page_number",
            "selector": "new URLSearchParams(location.search).get('page') || document.querySelector('.s-pagination-selected')?.textContent?.trim() || '1'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_name",
            "selector": "h2 span",
            "attribute": "text"
          },
          {
            "name": "sponsored",
            "selector": "(/Sponsored|スポンサー|スポンサ/.test(ROW.innerText) ? 'true' : 'false')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_url",
            "selector": "ROW.getAttribute('data-asin') ? 'https://www.amazon.co.jp/dp/' + ROW.getAttribute('data-asin') : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "asin",
            "selector": "",
            "attribute": "data-asin"
          },
          {
            "name": "ranking",
            "selector": ".a-icon-star-small .a-icon-alt, .a-icon-star .a-icon-alt, .a-icon-alt",
            "attribute": "text"
          },
          {
            "name": "review_count",
            "selector": "a[href*=\"customerReviews\"] span, a[href*=\"#customerReviews\"] span",
            "attribute": "text"
          },
          {
            "name": "review_url",
            "selector": "ROW.getAttribute('data-asin') ? 'https://www.amazon.co.jp/dp/' + ROW.getAttribute('data-asin') + '#customerReviews' : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": ".a-price .a-offscreen",
            "attribute": "text"
          },
          {
            "name": "previous_price",
            "selector": ".a-price.a-text-price .a-offscreen, .a-text-price .a-offscreen",
            "attribute": "text"
          },
          {
            "name": "image_url",
            "selector": "img.s-image",
            "attribute": "src"
          }
        ]
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "selector": "a.s-pagination-next:not(.s-pagination-disabled)[href], a[aria-label=\"Next\"]:not(.s-pagination-disabled)[href]",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1920,
      "position_y": 560,
      "config": {
        "selector": "a.s-pagination-next:not(.s-pagination-disabled)[href], a[aria-label=\"Next\"]:not(.s-pagination-disabled)[href]",
        "timeout": 20,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 2280,
      "position_y": 560,
      "config": {
        "timeout": 45,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2640,
      "position_y": 560,
      "config": {
        "duration": 3,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 3000,
      "position_y": 560,
      "config": {
        "selector": "div.s-main-slot div[data-component-type=\"s-search-result\"][data-asin]:not([data-asin=\"\"])",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2280,
      "position_y": 900,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": 116,
      "width": 3200,
      "height": 636,
      "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": 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": 636,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2208,
      "position_y": 796,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort Amazon.co.jp keyword product listing scraper equivalent to the Octoparse template. Starts from an Amazon Japan search URL for keyword 'kindle', extracts listing fields such as site, delivery destination, keyword, page number, product name, sponsored flag, product URL, ASIN, rating/ranking text, review count, review URL, price, previous price, and image URL. Pagination is implemented with a click-next loop and CSV append mode so all reachable search-result pages are collected until Amazon disables/removes the Next link. Product and review URLs are generated from ASIN when Amazon listing links are inconsistent. Amazon may show CAPTCHA, anti-bot checks, geo/location prompts, or layout variations; manually solve CAPTCHA or set postal code/location in the browser profile if required.",
      "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 (site, delivery_destination, keyword, page_number, sponsored). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 200,
      "width": 340,
      "height": 133,
      "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.s-pagination-next:not(.s-pagination-disabled)[href], a[aria-label=\"Next\"]:not(.s-pagination-disabled)[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": 166,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-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": 540,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    }
  ]
}