{
  "version": "1.0.0",
  "exported_at": "2026-06-03T06:50:00.000Z",
  "project": {
    "name": "Amazon Japan Product Scraper By URLs",
    "description": "Scrapes Amazon Japan product data from a supplied URL list, appending one CSV row per product URL. Equivalent to the Octoparse Amazon Japan Product Scraper (By URLs): extracts keyword/search context when available, ASIN, product name, product link, price, review count, rating, and page number. Navigation uses a multi-URL loop with loop-continue. The original sponsored redirect URLs in the Octoparse sample returned Amazon 404 in analysis, so this template is prefilled with direct /dp/ ASIN URLs and should be updated with current valid Amazon Japan product URLs. Amazon may block automated access with CAPTCHA or bot checks.",
    "color": "bg-[#ff9900]",
    "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
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 480,
      "position_y": 220,
      "config": {
        "urls": [
          "https://www.amazon.co.jp/dp/B09ZX9YG6H?keywords=wireless+charger&sr=8-1-spons",
          "https://www.amazon.co.jp/dp/B07N1DJ6W6?keywords=wireless+charger&sr=8-2-spons",
          "https://www.amazon.co.jp/dp/B07T4NNV1B?keywords=wireless+charger&sr=8-3-spons"
        ],
        "color": "bg-[#ff9900]"
      }
    },
    {
      "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": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "rowSelector": "body",
        "fileName": "amazon-japan-product-scraper-by-urls.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "keyword",
            "selector": "(() => { const urls=[location.href]; try { const sp=new URL(location.href).searchParams; const nested=sp.get('url'); if(nested) urls.push(new URL(nested, location.origin).href); } catch(e) {} for (const href of urls) { try { const u=new URL(href, location.origin); const v=u.searchParams.get('keywords') || u.searchParams.get('k') || u.searchParams.get('field-keywords'); if(v) return v.replace(/\\+/g,' '); } catch(e) {} } const search=document.querySelector('#twotabsearchtextbox'); return search ? search.value : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "search_result_count",
            "selector": "(() => { const el=document.querySelector('.s-desktop-toolbar .a-section.a-spacing-small.a-spacing-top-small span, [data-cel-widget=\\'UPPER-RESULT_INFO_BAR-0\\'] span'); const txt=el ? el.textContent : ''; const m=txt.match(/[\\d,]+/g); return m && m.length ? m[m.length-1].replace(/,/g,'') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rank",
            "selector": "(() => { const href=location.href; const all=[href]; try { const nested=new URL(href).searchParams.get('url'); if(nested) all.push(decodeURIComponent(nested)); } catch(e) {} for (const s of all) { const m=s.match(/[?&]sr=\\d+-(\\d+)/) || s.match(/sr_\\d+_(\\d+)/) || s.match(/sr_pg\\d+_(\\d+)/); if(m) return m[1]; } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "asin",
            "selector": "(() => { const dom=document.querySelector('#ASIN, input[name=\\'ASIN\\']'); if(dom && (dom.value || dom.getAttribute('value'))) return dom.value || dom.getAttribute('value'); const row=ROW.querySelector('[data-asin]'); if(row && row.getAttribute('data-asin')) return row.getAttribute('data-asin'); const urls=[location.href]; try { const nested=new URL(location.href).searchParams.get('url'); if(nested) urls.push(decodeURIComponent(nested)); } catch(e) {} for (const s of urls) { const m=s.match(/\\/(?:dp|gp\\/product)\\/([A-Z0-9]{10})/i); if(m) return m[1].toUpperCase(); } return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_name",
            "selector": "(() => { const el=document.querySelector('#productTitle, h1#title span, [data-component-type=\\'s-search-result\\'] h2 a span, h2 a.a-link-normal span'); if(el) return el.textContent.trim(); const meta=document.querySelector('meta[property=\\'og:title\\']'); return meta ? meta.content.replace(/\\s*\\|\\s*Amazon.*$/,'').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_link",
            "selector": "(() => { const canonical=document.querySelector('link[rel=\\'canonical\\']'); if(canonical && canonical.href) return canonical.href; const a=document.querySelector('h2 a.a-link-normal, a.a-link-normal[href*=\\'/dp/\\']'); return a ? new URL(a.getAttribute('href'), location.origin).href : location.href; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const clean=s => (s || '').replace(/\\s+/g,' ').trim(); const selectors=['#corePriceDisplay_desktop_feature_div .a-price .a-offscreen','#corePrice_feature_div .a-price .a-offscreen','#apex_desktop .a-price .a-offscreen','#newBuyBoxPrice','#priceblock_ourprice','#priceblock_dealprice','#price_inside_buybox','#sns-base-price .a-offscreen','#tp_price_block_total_price_ww .a-offscreen','.reinventPricePriceToPayMargin .a-price .a-offscreen','.a-price[data-a-size] .a-offscreen','.a-price .a-offscreen']; for (const s of selectors) { const el=document.querySelector(s); const txt=clean(el && el.textContent); if(txt && /[￥¥\\d]/.test(txt)) return txt; } const containers=['#corePriceDisplay_desktop_feature_div','#corePrice_feature_div','#apex_desktop','#buybox','#desktop_buybox']; for (const c of containers) { const root=document.querySelector(c); if(!root) continue; const whole=root.querySelector('.a-price-whole'); const frac=root.querySelector('.a-price-fraction'); if(whole && clean(whole.textContent)) return '￥' + clean(whole.textContent).replace(/[^\\d,]/g,'') + (frac && clean(frac.textContent) ? '.' + clean(frac.textContent).replace(/[^\\d]/g,'') : ''); const txt=clean(root.textContent); const m=txt.match(/[￥¥]\\s?[\\d,]+(?:\\.\\d{2})?/); if(m) return m[0].replace(/\\s+/g,''); } const body=clean(document.body.innerText); const m=body.match(/[￥¥]\\s?[\\d,]+(?:\\.\\d{2})?/); return m ? m[0].replace(/\\s+/g,'') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_count",
            "selector": "(() => { const el=document.querySelector('#acrCustomerReviewText, a[href*=\\'customerReviews\\'] span, [data-hook=\\'total-review-count\\']'); if(!el) return ''; const m=el.textContent.trim().match(/[\\d,\\.]+/); return m ? m[0] : el.textContent.trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(() => { const el=document.querySelector('#acrPopover .a-icon-alt, i.a-icon-star .a-icon-alt, [data-hook=\\'rating-out-of-text\\'], [aria-label*=\\'5つ星\\']'); return el ? (el.textContent || el.getAttribute('aria-label') || '').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "page_number",
            "selector": "(() => { const urls=[location.href]; try { const nested=new URL(location.href).searchParams.get('url'); if(nested) urls.push(decodeURIComponent(nested)); } catch(e) {} for (const s of urls) { try { const u=new URL(s, location.origin); const p=u.searchParams.get('page'); if(p) return p; } catch(e) {} const m=s.match(/sr_pg(\\d+)/) || s.match(/[?&]page=(\\d+)/); if(m) return m[1]; } return '1'; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 520,
      "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": "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": "loop-continue-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": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "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": 2208,
      "position_y": 416,
      "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 data from a supplied URL list, appending one CSV row per product URL. Equivalent to the Octoparse Amazon Japan Product Scraper (By URLs): extracts keyword/search context when available, ASIN, product name, product link, price, review count, rating, and page number. Navigation uses a multi-URL loop with loop-continue. The original sponsored redirect URLs in the Octoparse sample returned Amazon 404 in analysis, so this template is prefilled with direct /dp/ ASIN URLs and should be updated with current valid Amazon Japan product URLs. Amazon may block automated access with CAPTCHA or bot checks.",
      "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 3 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "position_y": 200,
      "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 (keyword, search_result_count, rank, asin, product_name). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 200,
      "width": 340,
      "height": 132,
      "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": 2480,
      "position_y": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}