{
  "version": "1.0.0",
  "exported_at": "2026-06-03T00:00:00.000Z",
  "project": {
    "name": "Transfermarktde TOP Scorers Scraper",
    "description": "Scrapes Transfermarkt.de Bundesliga top scorers data matching the Octoparse template preview: competition, player portrait image, player name, profile URL, position, nationality, age, club, appearances, and goals. Uses Transfermarkt's top scorers listing URL and a click-next pagination loop to append all available paginated rows, not only page 1. Best effort: Transfermarkt may show cookie consent, bot protection, or change table selectors.",
    "color": "bg-[#42be65]",
    "template_id": "ai-generated-transfermarkt-top-scorers"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser viewport size",
      "position_x": 80,
      "position_y": 220,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 440,
      "position_y": 220,
      "config": {
        "url": "https://www.transfermarkt.de/bundesliga/torschuetzenliste/wettbewerb/L1/saison_id/2023",
        "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": 800,
      "position_y": 220,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute JavaScript on the page",
      "position_x": 1160,
      "position_y": 220,
      "config": {
        "jsCode": "(() => {\n  const candidates = [\n    '#onetrust-accept-btn-handler',\n    'button#onetrust-accept-btn-handler',\n    'button[aria-label=\"Accept\"]',\n    'button[title=\"Accept\"]',\n    '.fc-cta-consent',\n    '.fc-button-label'\n  ];\n  for (const selector of candidates) {\n    const el = document.querySelector(selector);\n    if (el) {\n      const btn = el.closest('button') || el;\n      btn.click();\n      return 'clicked-consent';\n    }\n  }\n  return 'no-consent-found';\n})()",
        "waitForCompletion": true,
        "timeout": 5,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1520,
      "position_y": 220,
      "config": {
        "selector": "table.items > tbody > tr.odd, table.items > tbody > tr.even",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1880,
      "position_y": 220,
      "config": {
        "rowSelector": "table.items > tbody > tr.odd, table.items > tbody > tr.even",
        "fileName": "Transfermarkt-de-top-torschuetzen-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "wettbewerb",
            "selector": "'Bundesliga'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "spieler_bild",
            "selector": "(ROW.querySelector('img.bilderrahmen-fixed, img.lazy')?.getAttribute('data-src') || ROW.querySelector('img.bilderrahmen-fixed, img.lazy')?.getAttribute('src') || '')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "spieler_name",
            "selector": "table.inline-table td.hauptlink a",
            "attribute": "text"
          },
          {
            "name": "spieler_profil",
            "selector": "table.inline-table td.hauptlink a",
            "attribute": "href"
          },
          {
            "name": "spieler_position",
            "selector": "table.inline-table tr:nth-child(2) td",
            "attribute": "text"
          },
          {
            "name": "nationalitaet",
            "selector": "Array.from(ROW.querySelectorAll('img.flaggenrahmen')).map(img => img.getAttribute('title') || img.getAttribute('alt') || '').filter(Boolean).join(';')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "alter",
            "selector": "td:nth-child(4)",
            "attribute": "text"
          },
          {
            "name": "verein",
            "selector": "(ROW.querySelector('img.tiny_wappen')?.getAttribute('title') || ROW.querySelector('img.tiny_wappen')?.getAttribute('alt') || ROW.querySelector('td:nth-child(5) a')?.textContent?.trim() || '')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "einsaetze",
            "selector": "td:nth-child(6)",
            "attribute": "text"
          },
          {
            "name": "tore",
            "selector": "td:nth-child(7)",
            "attribute": "text"
          }
        ]
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 2240,
      "position_y": 220,
      "config": {
        "selector": "li.tm-pagination__list-item--icon-next-page:not(.tm-pagination__list-item--disabled) a, li.naechste-seite:not(.disabled) a, a[title=\"Zur nächsten Seite\"]",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1160,
      "position_y": 560,
      "config": {
        "selector": "li.tm-pagination__list-item--icon-next-page:not(.tm-pagination__list-item--disabled) a, li.naechste-seite:not(.disabled) a, a[title=\"Zur nächsten Seite\"]",
        "timeout": 10,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-page-load-2",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 1520,
      "position_y": 560,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1880,
      "position_y": 560,
      "config": {
        "selector": "table.items > tbody > tr.odd, table.items > tbody > tr.even",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2240,
      "position_y": 560,
      "config": {
        "duration": 2,
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 2600,
      "position_y": 560,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "click-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": "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": "wait-for-element-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-2",
      "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"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 8,
      "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": 368,
      "position_y": 116,
      "width": 2120,
      "height": 636,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "wait-for-page-load-2",
          "wait-for-element-2",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1088,
      "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": 1808,
      "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": 1088,
      "position_y": 116,
      "width": 1400,
      "height": 636,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1"
        ]
      }
    },
    {
      "id": "group-control",
      "element_type": "group",
      "title": "Control Flow",
      "color": "#8d8d8d",
      "position_x": 2528,
      "position_y": 456,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Transfermarkt.de Bundesliga top scorers data matching the Octoparse template preview: competition, player portrait image, player name, profile URL, position, nationality, age, club, appearances, and goals. Uses Transfermarkt's top scorers listing URL and a click-next pagination loop to append all available paginated rows, not only page 1. Best effort: Transfermarkt may show cookie consent, bot protection, or change table selectors.",
      "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: `(() => {\n  const candidates = [\n    '#onetrust-accept-btn-handler',\n    'button#onetrust-accept-btn-...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1360,
      "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": "Structured export with JS columns (wettbewerb, spieler_bild, nationalitaet, verein). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2080,
      "position_y": 200,
      "width": 340,
      "height": 129,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `li.tm-pagination__list-item--icon-next-page:not(.tm-pagination__list-item--disabled) a, li.naechste-seite:not(.disabled)`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 2440,
      "position_y": 200,
      "width": 340,
      "height": 170,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "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": 1360,
      "position_y": 540,
      "width": 316,
      "height": 106,
      "z_index": 22,
      "data": {
        "block_id": "click-1"
      }
    }
  ]
}