{
  "version": "1.0.0",
  "exported_at": "2026-05-31T10:30:00.000Z",
  "project": {
    "name": "eBay Listing Page Scraper by keyword",
    "description": "Scrapes eBay Australia keyword listing results for product keyword, title, URL, subtitle, condition, rating, price, image URL, current page URL, and page number. Seeded for keyword 'iPad'. Pagination uses a finite known-URL list for pages 1-5 with loop-continue and CSV append mode, avoiding the unreliable click-next loop that can repeat page 1. To scrape more pages or another keyword/country, edit the Navigate block's urls list.",
    "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": 220,
      "config": {
        "urls": [
          "https://www.ebay.com.au/sch/i.html?_nkw=iPad&_sacat=0&_from=R40&_pgn=1",
          "https://www.ebay.com.au/sch/i.html?_nkw=iPad&_sacat=0&_from=R40&_pgn=2",
          "https://www.ebay.com.au/sch/i.html?_nkw=iPad&_sacat=0&_from=R40&_pgn=3",
          "https://www.ebay.com.au/sch/i.html?_nkw=iPad&_sacat=0&_from=R40&_pgn=4",
          "https://www.ebay.com.au/sch/i.html?_nkw=iPad&_sacat=0&_from=R40&_pgn=5"
        ],
        "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": 220,
      "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": 220,
      "config": {
        "selector": ".s-card",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 220,
      "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": 1560,
      "position_y": 220,
      "config": {
        "rowSelector": ".s-card",
        "fileName": "ebay-product-list-scraper-by-keyword.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "site_url",
            "selector": "'https://www.ebay.com.au/'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_page_url",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_page",
            "selector": "new URLSearchParams(window.location.search).get('_pgn') || '1'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "keyword",
            "selector": "new URLSearchParams(window.location.search).get('_nkw') || ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "title",
            "selector": "(() => { const el = ROW.querySelector('.s-card__title'); return ((el && (el.innerText || el.textContent)) || '').replace(/\\s*Opens in a new window or tab\\s*/gi, '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "product_url",
            "selector": "a.s-card__link",
            "attribute": "href"
          },
          {
            "name": "sub_title",
            "selector": ".s-card__subtitle",
            "attribute": "text"
          },
          {
            "name": "condition",
            "selector": "(() => { const el = ROW.querySelector('.s-card__subtitle'); const sub = ((el && (el.innerText || el.textContent)) || '').trim(); return sub.split('·')[0].replace(/\\s*-\\s*Refurbished/i, '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(() => Array.from(ROW.querySelectorAll('[aria-label], .clipped, span')).map(el => (el.getAttribute('aria-label') || el.textContent || '').trim()).filter(Boolean).find(t => /out of 5 stars/i.test(t)) || '')()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "pricing",
            "selector": ".s-card__price",
            "attribute": "text"
          },
          {
            "name": "image_url",
            "selector": "(() => { const img = ROW.querySelector('img.s-card__image, .s-card__image img, img'); return img ? (img.currentSrc || img.src || img.getAttribute('data-src') || img.getAttribute('src') || '') : ''; })()",
            "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": 220,
      "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": "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": 116,
      "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": 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": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes eBay Australia keyword listing results for product keyword, title, URL, subtitle, condition, rating, price, image URL, current page URL, and page number. Seeded for keyword 'iPad'. Pagination uses a finite known-URL list for pages 1-5 with loop-continue and CSV append mode, avoiding the unreliable click-next loop that can repeat page 1. To scrape more pages or another keyword/country, edit the Navigate block's urls list.",
      "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": 320,
      "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 (site_url, current_page_url, current_page, keyword, title). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "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": 2120,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}