{
  "version": "1.0.0",
  "exported_at": "2026-06-01T14:25:00.000Z",
  "project": {
    "name": "eBay Product Listing Scraper for Germany",
    "description": "Scrapes eBay.de product search/listing pages for page number, product URL, image URL, title, condition, price, original price, shipping, and selling situation. Starts from the sample eBay.de search URL for 'spielzeug' and follows enabled pagination links until no next page or no product links are detected. The workflow injects a product-card normalization script on every page to convert eBay's changing listing markup into stable off-screen rows before export. Best-effort template: eBay may show bot checks/CAPTCHA, consent screens, empty pages, or change markup.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser viewport size",
      "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": {
        "url": "https://www.ebay.de/sch/i.html?_from=R40&_trksid=p4432023.m570.l1313&_nkw=spielzeug&_sacat=0",
        "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": 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": 5
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "selector": "a[href*='/itm/']"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "waitForCompletion": true,
        "timeout": 20,
        "jsCode": "(function(){const old=document.getElementById('uscraper-ebay-results');if(old)old.remove();const root=document.createElement('div');root.id='uscraper-ebay-results';root.style.cssText='position:absolute;left:-10000px;top:0;width:900px;background:white;color:black;opacity:0.01;z-index:-1;pointer-events:none;font-size:12px;line-height:16px;';document.body.appendChild(root);const norm=s=>(s||'').replace(/\\s+/g,' ').trim();const clean=s=>norm(s).replace(/^Neues Angebot\\s*/i,'').replace(/^New Listing\\s*/i,'').trim();const pageNum=(()=>{try{const u=new URL(location.href);return u.searchParams.get('_pgn')||'1';}catch(e){return '1';}})();const itemId=href=>{const m=String(href||'').match(/\\/itm\\/(?:[^/?#]+\\/)?(\\d{6,})|\\/itm\\/(\\d{6,})/);return m?(m[1]||m[2]):'';};const abs=href=>{try{return new URL(href,location.href).href;}catch(e){return href||'';}};const txt=el=>norm((el&&('innerText'in el?el.innerText:el.textContent))||'');function qText(card,selectors){for(const q of selectors){const el=card.querySelector(q);const t=clean(txt(el));if(t)return t;}return '';}function qAttr(card,selectors,attr){for(const q of selectors){const el=card.querySelector(q);if(el){const v=norm(el.getAttribute(attr)||'');if(v)return v;}}return '';}function findCard(a){let c=a.closest('li.s-item,.s-item,.s-card,[data-testid=\"item-card\"],[data-testid*=\"item\"],article,li');let el=a;for(let i=0;el&&i<8&&el!==document.body;i++,el=el.parentElement){const t=txt(el);if(t.length>20&&t.length<2500&&el.querySelector('img')&&(/(EUR|€|\\d+[,.]\\d{2})/i.test(t))&&!/Sortieren:|Verwandt:|Beschreibung einschließen/i.test(t)){return el;}}if(c){const t=txt(c);if(t.length<2500&&!/Sortieren:|Verwandt:|Beschreibung einschließen/i.test(t))return c;}return null;}const anchors=Array.from(document.querySelectorAll('a[href*=\"/itm/\"]')).filter(a=>itemId(a.href||a.getAttribute('href')));const seen=new Set();for(const a of anchors){const id=itemId(a.href||a.getAttribute('href'));if(seen.has(id))continue;seen.add(id);const card=findCard(a);if(!card)continue;const all=txt(card);if(!all||/Verwandt:|Sortieren:|Beschreibung einschließen/i.test(all))continue;const href=abs(a.href||a.getAttribute('href'));const imgEl=card.querySelector('img[src],img[data-src],img[data-lazy-src]');const image=imgEl?(imgEl.currentSrc||imgEl.src||imgEl.getAttribute('data-src')||imgEl.getAttribute('data-lazy-src')||''):'';let title=qText(card,['.s-item__title [role=\"heading\"]','.s-item__title','.s-card__title','[role=\"heading\"]','h3','h2']);if(!title){title=clean(a.getAttribute('aria-label')||a.getAttribute('title')||'');}if(!title&&imgEl){title=clean(imgEl.getAttribute('alt')||'');}if(!title||/Shop on eBay|Mehr zum Thema|Verwandt:|Sortieren:|Beschreibung einschließen|Anzeige|Sponsored/i.test(title))continue;const price=qText(card,['.s-item__price','.s-card__price','[class*=\"price\"]']);const original=qText(card,['s','del','.STRIKETHROUGH','.s-item__original-price','.s-card__original-price','[class*=\"original\"]']);let condition=qText(card,['.SECONDARY_INFO','.s-item__subtitle .SECONDARY_INFO','.s-item__subtitle','.s-card__subtitle','[class*=\"condition\"]']);const cm=(condition||all).match(/\\b(Brandneu|Neu|Gebraucht|Generalüberholt|Sehr gut|Gut|Akzeptabel|Nicht bewertet)\\b/i);condition=cm?cm[0]:condition;const shipParts=[];card.querySelectorAll('.s-item__shipping,.s-card__shipping,.s-item__logisticsCost,.s-item__free-returns,[class*=\"shipping\"],[class*=\"logistics\"],[class*=\"delivery\"]').forEach(el=>{const t=txt(el);if(t&&/Versand|Rückversand|Lieferung|Kostenlos|\\+\\s*EUR/i.test(t))shipParts.push(t);});let shipping=Array.from(new Set(shipParts)).slice(0,3).join(' | ');if(!shipping){const sm=all.match(/(?:Kostenloser Versand|\\+\\s*EUR\\s*\\d+[,.]\\d+\\s*Versand|Verkäufer zahlt Rückversand)/i);shipping=sm?sm[0]:'';}const saleParts=[];card.querySelectorAll('.s-item__quantitySold,.s-card__quantitySold,.s-item__hotness,.s-card__hotness,.s-item__purchase-options-with-icon,[class*=\"quantitySold\"],[class*=\"hotness\"],[class*=\"sold\"],[class*=\"watchers\"]').forEach(el=>{const t=txt(el);if(t)saleParts.push(t);});let sale=Array.from(new Set(saleParts)).slice(0,3).join(' | ');if(!sale){const m=all.match(/\\d+\\s*(?:verkauft|Beobachter|Gebote)|Letzter Artikel|Fast ausverkauft/i);sale=m?m[0]:'';}const row=document.createElement('div');row.className='us-row';function add(cls,val){const s=document.createElement('span');s.className=cls;s.textContent=val||'';row.appendChild(s);}add('page_num',pageNum);add('produkt_url',href);add('image_url',image);add('produkt_titel',title);add('neu_oder_gebraucht',condition);add('preis',price);add('urspruenglicher_preis',original);add('versand',shipping);add('verkaufssituation',sale);root.appendChild(row);}})();"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2280,
      "position_y": 220,
      "config": {
        "rowSelector": "#uscraper-ebay-results .us-row",
        "fileName": "ebay_produkt_listing_scraper_cards.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "page_num",
            "selector": ".page_num",
            "attribute": "text"
          },
          {
            "name": "produkt_url",
            "selector": ".produkt_url",
            "attribute": "text"
          },
          {
            "name": "image_url",
            "selector": ".image_url",
            "attribute": "text"
          },
          {
            "name": "produkt_titel",
            "selector": ".produkt_titel",
            "attribute": "text"
          },
          {
            "name": "neu_oder_gebraucht",
            "selector": ".neu_oder_gebraucht",
            "attribute": "text"
          },
          {
            "name": "preis",
            "selector": ".preis",
            "attribute": "text"
          },
          {
            "name": "urspruenglicher_preis",
            "selector": ".urspruenglicher_preis",
            "attribute": "text"
          },
          {
            "name": "versand",
            "selector": ".versand",
            "attribute": "text"
          },
          {
            "name": "verkaufssituation",
            "selector": ".verkaufssituation",
            "attribute": "text"
          }
        ]
      }
    },
    {
      "block_id": "element-exists-2",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2640,
      "position_y": 220,
      "config": {
        "selector": "a.pagination__next[href]:not([aria-disabled='true']):not(.pagination__next--disabled), a[aria-label*='Nächste'][href]:not([aria-disabled='true']), a[aria-label*='Weiter'][href]:not([aria-disabled='true']), a[aria-label*='next' i][href]:not([aria-disabled='true'])"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 3000,
      "position_y": 220,
      "config": {
        "selector": "a.pagination__next[href]:not([aria-disabled='true']):not(.pagination__next--disabled), a[aria-label*='Nächste'][href]:not([aria-disabled='true']), a[aria-label*='Weiter'][href]:not([aria-disabled='true']), a[aria-label*='next' i][href]:not([aria-disabled='true'])",
        "timeout": 15
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 3360,
      "position_y": 220,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3360,
      "position_y": 560,
      "config": {
        "duration": 5
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 1560,
      "position_y": 560,
      "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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "inject-javascript-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": "inject-javascript-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-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "from_connector_id": "true",
      "to_block_id": "click-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-2",
      "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": "element-exists-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": 3200,
      "height": 636,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-page-load-2",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1488,
      "position_y": 116,
      "width": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "element-exists-2",
          "click-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1848,
      "position_y": 116,
      "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": 2208,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 1488,
      "position_y": 456,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes eBay.de product search/listing pages for page number, product URL, image URL, title, condition, price, original price, shipping, and selling situation. Starts from the sample eBay.de search URL for 'spielzeug' and follows enabled pagination links until no next page or no product links are detected. The workflow injects a product-card normalization script on every page to convert eBay's changing listing markup into stable off-screen rows before export. Best-effort template: eBay may show bot checks/CAPTCHA, consent screens, empty pages, or change markup.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `a[href*='/itm/']`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 200,
      "width": 340,
      "height": 135,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(function(){const old=document.getElementById('uscraper-ebay-results');if(old)old.remove();const roo...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 200,
      "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-results .us-row`. Confirm row count > 0 before running at scale.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 200,
      "width": 340,
      "height": 114,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-2",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `a.pagination__next[href]:not([aria-disabled='true']):not(.pagination__next--disabled), a[aria-label*='Nächste'][href]:no`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 200,
      "width": 340,
      "height": 170,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-2"
      }
    },
    {
      "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": 3200,
      "position_y": 200,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    }
  ]
}