{
  "version": "1.0.0",
  "exported_at": "2026-06-03T12:30:00.000Z",
  "project": {
    "name": "eBay Details Scraper By Search Keywords",
    "description": "Best-effort eBay keyword scraper equivalent to the Octoparse template. Preconfigured for keyword 'switch 2 console new sealed' and pages 1-20 using eBay search URLs. Pagination uses navigate.urls[] plus loop-continue and appends all pages to ebay_details.csv. A JavaScript normalization step scans whatever eBay result markup is present, finds item detail links containing /itm/, de-duplicates by item number, and creates stable synthetic rows for extraction. eBay may still show consent, CAPTCHA, bot protection, or omit seller/detail fields from search results; full detail-page gallery extraction requires pre-enumerated item detail URLs because UScraper cannot pipe extracted links into a second navigation loop.",
    "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": {
        "urls": [
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=1",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=2",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=3",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=4",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=5",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=6",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=7",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=8",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=9",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=10",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=11",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=12",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=13",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=14",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=15",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=16",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=17",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=18",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=19",
          "https://www.ebay.com/sch/i.html?_from=R40&_nkw=switch+2+console+new+sealed&_sacat=0&LH_ItemCondition=1000&_ipg=240&_pgn=20"
        ],
        "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": 480,
      "position_y": 240,
      "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": 240,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "jsCode": "(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); const buttons = Array.from(document.querySelectorAll('button, input[type=\"button\"], input[type=\"submit\"], a[role=\"button\"]')); const accept = buttons.find(b => /^(accept|accept all|agree|agree and continue|i agree|continue)$/i.test(clean(b.innerText || b.value))); if (accept) { try { accept.click(); } catch(e) {} } document.querySelectorAll('.uscraper-ebay-row').forEach(e => e.remove()); const container = document.createElement('div'); container.id = 'uscraper-ebay-normalized-results'; container.style.display = 'none'; document.body.appendChild(container); const anchors = Array.from(document.querySelectorAll('a[href*=\"/itm/\"]')); const seen = new Set(); const getItemId = href => { const m = href.match(/\\/itm\\/(?:[^/?#]+\\/)?(\\d{9,})/) || href.match(/[?&]item=(\\d{9,})/); return m ? m[1] : ''; }; const nearestCard = a => a.closest('li.s-item, li, [data-testid*=\"item\"], [class*=\"item-card\"], [class*=\"s-item\"], article, div') || a.parentElement || a; const pickText = (root, sels) => { for (const sel of sels) { const el = root.querySelector(sel); const t = clean(el && el.textContent); if (t) return t; } return ''; }; const pickImg = root => { const img = root.querySelector('img[src], img[data-src], img[data-original]'); return img ? (img.currentSrc || img.src || img.getAttribute('data-src') || img.getAttribute('data-original') || '') : ''; }; for (const a of anchors) { const href = a.href || a.getAttribute('href') || ''; const item = getItemId(href); if (!item || seen.has(item)) continue; seen.add(item); const card = nearestCard(a); let title = pickText(card, ['.s-item__title', '[role=\"heading\"]', 'h3', 'h2', '.su-title', '[class*=\"title\"]']); if (!title) title = clean(a.getAttribute('aria-label') || a.textContent); title = title.replace(/^New Listing\\s*/i, '').trim(); const price = pickText(card, ['.s-item__price', '[data-testid=\"x-price-primary\"]', '[class*=\"price\"]']); const wasPrice = pickText(card, ['.s-item__was-price', '.s-item__original-price', '.STRIKETHROUGH', 's']); const condition = pickText(card, ['.s-item__subtitle .SECONDARY_INFO', '.SECONDARY_INFO', '.s-item__subtitle', '[class*=\"condition\"]']); const sellerText = pickText(card, ['.s-item__seller-info-text', '.s-item__seller-info', '[class*=\"seller\"]']); const sellerNameMatch = sellerText.match(/^(?:Seller:\\s*)?([^()]+?)\\s*(?:\\(|$)/i); const sellerRatingMatch = sellerText.match(/\\(([^)]+)\\)/); const feedbackMatch = sellerText.match(/(\\d+(?:\\.\\d+)?%)/); const allText = clean(card.textContent); const soldMatch = allText.match(/([\\d,]+)\\s+sold/i); const availMatch = allText.match(/(last one|almost gone|limited quantity|only\\s+\\d+\\s+left|more than\\s+\\d+\\s+available)/i); const epidMatch = href.match(/[?&]epid=(\\d+)/i); const row = document.createElement('div'); row.className = 'uscraper-ebay-row'; row.setAttribute('data-product-title', title); row.setAttribute('data-seller-name', sellerNameMatch ? clean(sellerNameMatch[1]) : ''); row.setAttribute('data-seller-rating', sellerRatingMatch ? sellerRatingMatch[1].replace(/[^0-9]/g, '') : ''); row.setAttribute('data-feedback-score', feedbackMatch ? feedbackMatch[1] : ''); row.setAttribute('data-price', price); row.setAttribute('data-was-price', wasPrice); row.setAttribute('data-condition', condition); row.setAttribute('data-sold', soldMatch ? soldMatch[1].replace(/,/g, '') : ''); row.setAttribute('data-availability', availMatch ? clean(availMatch[1]) : ''); row.setAttribute('data-image-urls', pickImg(card)); row.setAttribute('data-page-url', href); row.setAttribute('data-item-number', item); row.setAttribute('data-epid', epidMatch ? epidMatch[1] : ''); container.appendChild(row); } return document.querySelectorAll('.uscraper-ebay-row').length; })();",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "duration": 1,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "rowSelector": ".uscraper-ebay-row",
        "fileName": "ebay_details.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "Product_Title",
            "selector": "",
            "attribute": "data-product-title"
          },
          {
            "name": "Seller_Name",
            "selector": "",
            "attribute": "data-seller-name"
          },
          {
            "name": "Seller_Rating",
            "selector": "",
            "attribute": "data-seller-rating"
          },
          {
            "name": "Feedback_Score",
            "selector": "",
            "attribute": "data-feedback-score"
          },
          {
            "name": "Price",
            "selector": "",
            "attribute": "data-price"
          },
          {
            "name": "Was_Price",
            "selector": "",
            "attribute": "data-was-price"
          },
          {
            "name": "Condition",
            "selector": "",
            "attribute": "data-condition"
          },
          {
            "name": "Sold",
            "selector": "",
            "attribute": "data-sold"
          },
          {
            "name": "Availability",
            "selector": "",
            "attribute": "data-availability"
          },
          {
            "name": "Image_URLs",
            "selector": "",
            "attribute": "data-image-urls"
          },
          {
            "name": "Page_URL",
            "selector": "",
            "attribute": "data-page-url"
          },
          {
            "name": "Item_Number",
            "selector": "",
            "attribute": "data-item-number"
          },
          {
            "name": "Epid",
            "selector": "",
            "attribute": "data-epid"
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "color": "bg-[#ff832b]"
      }
    }
  ],
  "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": 136,
      "width": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1128,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "inject-javascript-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "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": 2208,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort eBay keyword scraper equivalent to the Octoparse template. Preconfigured for keyword 'switch 2 console new sealed' and pages 1-20 using eBay search URLs. Pagination uses navigate.urls[] plus loop-continue and appends all pages to ebay_details.csv. A JavaScript normalization step scans whatever eBay result markup is present, finds item detail links containing /itm/, de-duplicates by item number, and creates stable synthetic rows for extraction. eBay may still show consent, CAPTCHA, bot protection, or omit seller/detail fields from search results; full detail-page gallery extraction requires pre-enumerated item detail URLs because UScraper cannot pipe extracted links into a second navigation loop.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(() => { const clean = s => (s || '').replace(/\\s+/g, ' ').trim(); const buttons = Array.from(docume...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1400,
      "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-ebay-row`. Confirm row count > 0 before running at scale.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 220,
      "width": 340,
      "height": 110,
      "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": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}