{
  "version": "1.0.0",
  "exported_at": "2026-05-31T00:00:00.000Z",
  "project": {
    "name": "Yahoo Shopping Scraper by URL",
    "description": "Scrapes Yahoo Shopping search/listing URLs for the Octoparse-equivalent fields: 商品名, 店舗URL, 価格, 送料, ポイント, スターランキング, レビュー件数, 店舗名. Uses a bounded known-URL pagination strategy with Yahoo Shopping offset URLs (b=1,61,121,181,241) instead of click-next because Yahoo's dynamic next links can repeat and cause infinite loops. Replace the Navigate URLs with the desired Yahoo Shopping listing URL offsets if needed. Best-effort template; Yahoo may rate-limit, change markup, show interstitials, or block automated browsing.",
    "color": "bg-[#4589ff]",
    "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": 240,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to each Yahoo Shopping result page URL",
      "position_x": 480,
      "position_y": 240,
      "config": {
        "urls": [
          "https://shopping.yahoo.co.jp/search?p=%E6%B0%B4&b=1",
          "https://shopping.yahoo.co.jp/search?p=%E6%B0%B4&b=61",
          "https://shopping.yahoo.co.jp/search?p=%E6%B0%B4&b=121",
          "https://shopping.yahoo.co.jp/search?p=%E6%B0%B4&b=181",
          "https://shopping.yahoo.co.jp/search?p=%E6%B0%B4&b=241"
        ],
        "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": 840,
      "position_y": 240,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until page body exists",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "scroll-1",
      "block_type": "process",
      "title": "Scroll",
      "description": "Scroll down to trigger lazy-loaded Yahoo Shopping results",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "direction": "down",
        "amount": 2500
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Allow lazy-loaded content to render",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "scroll-2",
      "block_type": "process",
      "title": "Scroll",
      "description": "Scroll further to expose product listings",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "direction": "down",
        "amount": 3500
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Allow additional listing content to render",
      "position_x": 2640,
      "position_y": 240,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Normalize Yahoo Shopping product rows",
      "position_x": 3000,
      "position_y": 240,
      "config": {
        "jsCode": "(() => { const norm = s => (s || '').replace(/\\s+/g, ' ').trim(); const raw = el => el ? (el.innerText || el.textContent || el.getAttribute('aria-label') || el.getAttribute('title') || '') : ''; const cleanTitle = s => norm(s).replace(/(?:[￥¥]\\s*)?[\\d,]{2,}\\s*円.*$/,'').replace(/送料無料|送料[^\\s]*/g,'').replace(/ポイント|PayPay|獲得/g,'').trim(); const priceFrom = text => { const ms = Array.from((text || '').matchAll(/(?:[￥¥]\\s*)?([\\d,]{2,})\\s*円/g)).map(m => m[1]); return ms.length ? ms[ms.length - 1] : ''; }; const decodeUrl = href => { try { const u = new URL(href, location.href); const rd = u.searchParams.get('rdUrl') || u.searchParams.get('url') || u.searchParams.get('redirect') || ''; return rd ? decodeURIComponent(rd) : u.href; } catch(e) { return href || ''; } }; const sellerFrom = href => { try { const decoded = decodeUrl(href); const m = decoded.match(/store\\.shopping\\.yahoo\\.co\\.jp\\/([^\\/?#]+)/); if (m) return m[1]; const u = new URL(href, location.href); return u.searchParams.get('sellerId') || ''; } catch(e) { return ''; } }; const isProductUrl = href => /store\\.shopping\\.yahoo\\.co\\.jp\\/[^\\/?#]+\\/[^\\/?#]+|lohaco\\.yahoo\\.co\\.jp\\/store\\/[^\\/?#]+\\/item\\//i.test(href || ''); const bestContainer = a => { const candidates = []; let n = a; for (let i = 0; i < 10 && n && n !== document.body; i++, n = n.parentElement) { const t = norm(raw(n)); if (t.length > 20 && t.length < 8000) candidates.push(n); } const withPrice = candidates.filter(n => priceFrom(raw(n))); return withPrice.find(n => /LI|ARTICLE|SECTION/.test(n.tagName)) || withPrice[0] || a.closest('li,article,section,div') || a.parentElement; }; document.querySelectorAll('#uscraper-results').forEach(el => el.remove()); const linkRe = /store\\.shopping\\.yahoo\\.co\\.jp|shopping-item-reach\\.yahoo\\.co\\.jp|ck\\.storematch\\.jp\\/rd|lohaco\\.yahoo\\.co\\.jp\\/store/i; const links = Array.from(document.querySelectorAll('a[href]')).filter(a => linkRe.test(a.href) && !/\\/search\\?|\\/promotion\\//.test(a.href)); const products = []; for (const a of links) { const row = bestContainer(a); if (!row) continue; const textRaw = raw(row); const text = norm(textRaw); const price = priceFrom(text); if (!price) continue; const lines = textRaw.split(/\\n+/).map(norm).filter(Boolean); const anchors = Array.from(row.querySelectorAll('a[href]')).map(x => ({ href: x.href, decoded: decodeUrl(x.href), text: norm(raw(x) || x.getAttribute('title') || x.getAttribute('aria-label') || '') })).filter(x => x.href); const productAnchor = anchors.find(x => isProductUrl(x.decoded) && x.text.length > 8 && !/Yahoo!店$|ストア$|店$|会社概要|レビュー/.test(x.text)) || anchors.find(x => isProductUrl(x.decoded)) || { href: a.href, decoded: decodeUrl(a.href), text: norm(raw(a) || a.getAttribute('title') || a.getAttribute('aria-label') || '') }; const productUrl = productAnchor.decoded || productAnchor.href || ''; if (!isProductUrl(productUrl)) continue; let name = cleanTitle(productAnchor.text); if (!name || name.length < 4) name = cleanTitle(lines.find(l => l.length > 8 && !/[￥¥]|円|送料無料|送料|ポイント|レビュー|評価|%/.test(l)) || ''); if (!name || /飲料がお買い得|Coca Cola$|LIFEDRINK$/.test(name)) continue; const storeAnchor = anchors.find(x => /store\\.shopping\\.yahoo\\.co\\.jp\\/[^\\/?#]+\\/?(?:[?#]|$)/.test(x.decoded) && x.text && x.text !== productAnchor.text) || anchors.find(x => x.text && x.text.length < 70 && /店|ストア|LOHACO|Yahoo/i.test(x.text)); const shipping = (text.match(/送料無料|\\+\\s*送料\\s*[\\d,]+円|送料\\s*[\\d,]+円|送料[^\\s]{0,16}/) || [''])[0]; const point = (text.match(/(?:ポイント|PayPay|獲得)?\\s*(\\d+(?:\\.\\d+)?)\\s*%/) || [])[1]; const attrText = Array.from(row.querySelectorAll('[aria-label], [title]')).map(el => (el.getAttribute('aria-label') || '') + ' ' + (el.getAttribute('title') || '')).join(' '); const rating = ((attrText + ' ' + text).match(/([0-5](?:\\.\\d+)?)\\s*(?:点|\\/5|stars?|星)/i) || [])[1] || ''; const reviews = (text.match(/レビュー\\s*([\\d,]+)件|([\\d,]+)件のレビュー|レビュー件数\\s*([\\d,]+)|\\(([\\d,]+)件?\\)/) || []); let storeName = storeAnchor ? storeAnchor.text : ''; if (!storeName || storeName === name) storeName = lines.find(l => /Yahoo!店|ストア|LOHACO|店$/.test(l) && l.length < 80 && l !== name) || sellerFrom(productUrl); products.push({ product_name: name, store_url: productUrl, price, shipping, points: point ? point + '%' : '', rating, reviews: reviews[1] || reviews[2] || reviews[3] || reviews[4] || '', store_name: storeName }); } const seen = new Set(); const uniq = products.filter(p => { const key = (p.store_url || '') + '|' + p.product_name + '|' + p.price; if (seen.has(key)) return false; seen.add(key); return true; }); const container = document.createElement('div'); container.id = 'uscraper-results'; container.style.display = 'none'; for (const p of uniq) { const d = document.createElement('div'); d.setAttribute('data-uscraper-row', 'product'); d.dataset.productName = p.product_name; d.dataset.storeUrl = p.store_url; d.dataset.price = p.price; d.dataset.shipping = p.shipping; d.dataset.points = p.points; d.dataset.rating = p.rating; d.dataset.reviews = p.reviews; d.dataset.storeName = p.store_name; container.appendChild(d); } document.body.appendChild(container); return uniq.length; })();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until normalized product rows exist",
      "position_x": 3360,
      "position_y": 240,
      "config": {
        "selector": "#uscraper-results [data-uscraper-row=\"product\"]",
        "timeout": 20,
        "visible": false
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export Yahoo Shopping product rows",
      "position_x": 3720,
      "position_y": 240,
      "config": {
        "rowSelector": "#uscraper-results [data-uscraper-row=\"product\"]",
        "fileName": "yahoo_shopping_scraper_url.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "商品名",
            "selector": "",
            "attribute": "data-product-name"
          },
          {
            "name": "店舗URL",
            "selector": "",
            "attribute": "data-store-url"
          },
          {
            "name": "価格",
            "selector": "",
            "attribute": "data-price"
          },
          {
            "name": "送料",
            "selector": "",
            "attribute": "data-shipping"
          },
          {
            "name": "ポイント",
            "selector": "",
            "attribute": "data-points"
          },
          {
            "name": "スターランキング",
            "selector": "",
            "attribute": "data-rating"
          },
          {
            "name": "レビュー件数",
            "selector": "",
            "attribute": "data-reviews"
          },
          {
            "name": "店舗名",
            "selector": "",
            "attribute": "data-store-name"
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-URL pagination loop",
      "position_x": 4080,
      "position_y": 240,
      "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "scroll-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "scroll-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": "scroll-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "scroll-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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-1",
      "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"
    },
    {
      "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": 136,
      "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": 136,
      "width": 3200,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1",
          "sleep-2",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1488,
      "position_y": 136,
      "width": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "scroll-1",
          "scroll-2",
          "inject-javascript-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 3648,
      "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": 4008,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Yahoo Shopping search/listing URLs for the Octoparse-equivalent fields: 商品名, 店舗URL, 価格, 送料, ポイント, スターランキング, レビュー件数, 店舗名. Uses a bounded known-URL pagination strategy with Yahoo Shopping offset URLs (b=1,61,121,181,241) instead of click-next because Yahoo's dynamic next links can repeat and cause infinite loops. Replace the Navigate URLs with the desired Yahoo Shopping listing URL offsets if needed. Best-effort template; Yahoo may rate-limit, change markup, show interstitials, or block automated browsing.",
      "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 5 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "position_y": 220,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(() => { const norm = s => (s || '').replace(/\\s+/g, ' ').trim(); const raw = el => el ? (el.innerTe...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 3200,
      "position_y": 220,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "inject-javascript-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Extracts rows matching `#uscraper-results [data-uscraper-row=\"product\"]`. Confirm row count > 0 before running at scale.",
      "color": "#ee5396",
      "position_x": 3920,
      "position_y": 220,
      "width": 340,
      "height": 120,
      "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": 4280,
      "position_y": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}