{
  "version": "1.0.0",
  "exported_at": "2026-06-02T00:00:00.000Z",
  "project": {
    "name": "Sportium Scraper",
    "description": "Best-effort Sportium football odds scraper equivalent to the Octoparse Sportium template. It opens the Sportium football betting page, handles a possible cookie banner, scrolls to trigger lazy-loaded events, then exports country, league, match time, teams, 1X2 odds, goals, both-teams-to-score, handicap, winner, totals, and runs/carreras fields. No classic numbered pagination was identified from the provided catalog text; dynamic/lazy loading is handled with a scroll step. Sportium may geo-block, require login, age confirmation, or CAPTCHA.",
    "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": 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": 480,
      "position_y": 220,
      "config": {
        "url": "https://www.sportium.es/apuestas-deportivas/futbol",
        "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": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "selector": "//button[contains(translate(normalize-space(.), 'ACEPTARACCEPT', 'aceptaraccept'), 'acept') or contains(translate(normalize-space(.), 'ALLOWAGREE', 'allowagree'), 'allow') or contains(translate(normalize-space(.), 'ALLOWAGREE', 'allowagree'), 'agree')]",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "selector": "//button[contains(translate(normalize-space(.), 'ACEPTARACCEPT', 'aceptaraccept'), 'acept') or contains(translate(normalize-space(.), 'ALLOWAGREE', 'allowagree'), 'allow') or contains(translate(normalize-space(.), 'ALLOWAGREE', 'allowagree'), 'agree')]",
        "timeout": 10,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "duration": 2,
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 2280,
      "position_y": 540,
      "config": {
        "selector": "main [data-testid*='event'], main [data-testid*='Event'], main [class*='event'], main [class*='Event'], main article, body",
        "timeout": 60,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 2640,
      "position_y": 540,
      "config": {
        "jsCode": "window.__uscraperSportiumScrollTimer && clearInterval(window.__uscraperSportiumScrollTimer); window.__uscraperSportiumScrollTimer = setInterval(function(){ window.scrollBy(0, 900); }, 450); setTimeout(function(){ clearInterval(window.__uscraperSportiumScrollTimer); window.scrollTo(0, 0); }, 7000);",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 3000,
      "position_y": 540,
      "config": {
        "duration": 8,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 3360,
      "position_y": 540,
      "config": {
        "rowSelector": "main [data-testid*='event'], main [data-testid*='Event'], main [class*='event-card'], main [class*='EventCard'], main [class*='coupon-event'], main [class*='market-event'], main article",
        "fileName": "sportium-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "create",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "pais",
            "selector": "(() => { const bad=/\\b\\d+(?:[.,]\\d+)?\\b|Resultado|Goles|Ambos|Handicap|Ganador|Totales|Carreras|Hoy|Mañana|Manana/i; let labels=[]; for (let n=ROW; n && n!==document.body; n=n.parentElement) { let p=n.previousElementSibling; let guard=0; while (p && guard++<6) { const txt=(p.innerText||'').replace(/\\s+/g,' ').trim(); if (txt && txt.length<80 && !bad.test(txt)) labels.unshift(txt); p=p.previousElementSibling; } if (labels.length) break; } return labels[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "liga",
            "selector": "(() => { const bad=/\\b\\d+(?:[.,]\\d+)?\\b|Resultado|Goles|Ambos|Handicap|Ganador|Totales|Carreras/i; let labels=[]; for (let n=ROW; n && n!==document.body; n=n.parentElement) { let p=n.previousElementSibling; let guard=0; while (p && guard++<8) { const txt=(p.innerText||'').replace(/\\s+/g,' ').trim(); if (txt && txt.length<100 && !bad.test(txt)) labels.push(txt); p=p.previousElementSibling; } if (labels.length) break; } return labels[labels.length-1] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "fecha_hora",
            "selector": "(() => { const txt=(ROW.innerText||'').replace(/\\s+/g,' ').trim(); const m=txt.match(/(Hoy|Mañana|Manana|\\d{1,2}\\s+[a-záéíóúñ]{3,}\\s+\\d{1,2}:\\d{2}|\\d{1,2}:\\d{2}|\\b\\dT\\b)/i); return m ? m[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "local_1",
            "selector": "(() => { const num=/^\\d+(?:[.,]\\d+)?$/; const junk=/Resultado|Goles|Ambos|Handicap|Ganador|Totales|Carreras|Hoy|Mañana|Manana|Empate|Over|Under|Más|Menos/i; const els=Array.from(ROW.querySelectorAll('[data-testid*=participant],[data-testid*=competitor],[class*=participant],[class*=competitor],[class*=team],[class*=Team]')).map(e=>(e.innerText||e.textContent||'').replace(/\\s+/g,' ').trim()).filter(t=>t && t.length>1 && !num.test(t) && !junk.test(t)); const lines=(ROW.innerText||'').split('\\n').map(s=>s.trim()).filter(s=>s && s.length>1 && !num.test(s) && !junk.test(s)); const names=[...new Set(els.length ? els : lines)]; return names[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "visitante_2",
            "selector": "(() => { const num=/^\\d+(?:[.,]\\d+)?$/; const junk=/Resultado|Goles|Ambos|Handicap|Ganador|Totales|Carreras|Hoy|Mañana|Manana|Empate|Over|Under|Más|Menos/i; const els=Array.from(ROW.querySelectorAll('[data-testid*=participant],[data-testid*=competitor],[class*=participant],[class*=competitor],[class*=team],[class*=Team]')).map(e=>(e.innerText||e.textContent||'').replace(/\\s+/g,' ').trim()).filter(t=>t && t.length>1 && !num.test(t) && !junk.test(t)); const lines=(ROW.innerText||'').split('\\n').map(s=>s.trim()).filter(s=>s && s.length>1 && !num.test(s) && !junk.test(s)); const names=[...new Set(els.length ? els : lines)]; return names[1] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "resultado_1",
            "selector": "(() => { const nodes=Array.from(ROW.querySelectorAll('button,[data-testid*=odd],[data-testid*=price],[class*=odd],[class*=Odd],[class*=price],[class*=Price]')); let vals=nodes.map(e=>((e.innerText||e.textContent||'').match(/\\b\\d+[.,]\\d{2,3}\\b/)||[])[0]).filter(Boolean); if(!vals.length) vals=(ROW.innerText||'').match(/\\b\\d+[.,]\\d{2,3}\\b/g)||[]; return vals[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "resultado_x",
            "selector": "(() => { const nodes=Array.from(ROW.querySelectorAll('button,[data-testid*=odd],[data-testid*=price],[class*=odd],[class*=Odd],[class*=price],[class*=Price]')); let vals=nodes.map(e=>((e.innerText||e.textContent||'').match(/\\b\\d+[.,]\\d{2,3}\\b/)||[])[0]).filter(Boolean); if(!vals.length) vals=(ROW.innerText||'').match(/\\b\\d+[.,]\\d{2,3}\\b/g)||[]; return vals[1] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "resultado_2",
            "selector": "(() => { const nodes=Array.from(ROW.querySelectorAll('button,[data-testid*=odd],[data-testid*=price],[class*=odd],[class*=Odd],[class*=price],[class*=Price]')); let vals=nodes.map(e=>((e.innerText||e.textContent||'').match(/\\b\\d+[.,]\\d{2,3}\\b/)||[])[0]).filter(Boolean); if(!vals.length) vals=(ROW.innerText||'').match(/\\b\\d+[.,]\\d{2,3}\\b/g)||[]; return vals[2] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "goles_mas",
            "selector": "(() => { const txt=ROW.innerText||''; const totals=txt.match(/\\b\\d+[.,]5\\b/g)||[]; return totals[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "goles_menos",
            "selector": "(() => { const nodes=Array.from(ROW.querySelectorAll('button,[data-testid*=odd],[data-testid*=price],[class*=odd],[class*=Odd],[class*=price],[class*=Price]')); let vals=nodes.map(e=>((e.innerText||e.textContent||'').match(/\\b\\d+[.,]\\d{2,3}\\b/)||[])[0]).filter(Boolean); if(!vals.length) vals=(ROW.innerText||'').match(/\\b\\d+[.,]\\d{2,3}\\b/g)||[]; return vals[3] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ambos_marcan_yes",
            "selector": "(() => { const nodes=Array.from(ROW.querySelectorAll('button,[data-testid*=odd],[data-testid*=price],[class*=odd],[class*=Odd],[class*=price],[class*=Price]')); let vals=nodes.map(e=>((e.innerText||e.textContent||'').match(/\\b\\d+[.,]\\d{2,3}\\b/)||[])[0]).filter(Boolean); if(!vals.length) vals=(ROW.innerText||'').match(/\\b\\d+[.,]\\d{2,3}\\b/g)||[]; return vals[4] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ambos_marcan_no",
            "selector": "(() => { const nodes=Array.from(ROW.querySelectorAll('button,[data-testid*=odd],[data-testid*=price],[class*=odd],[class*=Odd],[class*=price],[class*=Price]')); let vals=nodes.map(e=>((e.innerText||e.textContent||'').match(/\\b\\d+[.,]\\d{2,3}\\b/)||[])[0]).filter(Boolean); if(!vals.length) vals=(ROW.innerText||'').match(/\\b\\d+[.,]\\d{2,3}\\b/g)||[]; return vals[5] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "handicap",
            "selector": "(() => { const txt=ROW.innerText||''; const h=txt.match(/[+-]\\d+(?:[.,]5)?/) || txt.match(/\\b\\d+[.,]5\\b/); return h ? h[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ganador",
            "selector": "(() => { const nodes=Array.from(ROW.querySelectorAll('button,[data-testid*=odd],[data-testid*=price],[class*=odd],[class*=Odd],[class*=price],[class*=Price]')); let vals=nodes.map(e=>((e.innerText||e.textContent||'').match(/\\b\\d+[.,]\\d{2,3}\\b/)||[])[0]).filter(Boolean); if(!vals.length) vals=(ROW.innerText||'').match(/\\b\\d+[.,]\\d{2,3}\\b/g)||[]; return vals[6] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "totales",
            "selector": "(() => { const txt=ROW.innerText||''; const totals=txt.match(/\\b\\d+[.,]5\\b/g)||[]; return totals[1] || totals[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "carreras",
            "selector": "(() => { const nodes=Array.from(ROW.querySelectorAll('button,[data-testid*=odd],[data-testid*=price],[class*=odd],[class*=Odd],[class*=price],[class*=Price]')); let vals=nodes.map(e=>((e.innerText||e.textContent||'').match(/\\b\\d+[.,]\\d{2,3}\\b/)||[])[0]).filter(Boolean); if(!vals.length) vals=(ROW.innerText||'').match(/\\b\\d+[.,]\\d{2,3}\\b/g)||[]; return vals[7] || ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "end-1",
      "block_type": "output",
      "title": "End",
      "description": "Terminate execution flow",
      "position_x": 3720,
      "position_y": 540,
      "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": "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "click-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": "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-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-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": "end-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": 2840,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1128,
      "position_y": 116,
      "width": 680,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 2568,
      "position_y": 436,
      "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": 3288,
      "position_y": 436,
      "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": 3648,
      "position_y": 436,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "end-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort Sportium football odds scraper equivalent to the Octoparse Sportium template. It opens the Sportium football betting page, handles a possible cookie banner, scrolls to trigger lazy-loaded events, then exports country, league, match time, teams, 1X2 odds, goals, both-teams-to-score, handicap, winner, totals, and runs/carreras fields. No classic numbered pagination was identified from the provided catalog text; dynamic/lazy loading is handled with a scroll step. Sportium may geo-block, require login, age confirmation, or CAPTCHA.",
      "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 `//button[contains(translate(normalize-space(.), 'ACEPTARACCEPT', 'aceptaraccept'), 'acept') or contains(translate(normal`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1400,
      "position_y": 200,
      "width": 340,
      "height": 170,
      "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: `window.__uscraperSportiumScrollTimer && clearInterval(window.__uscraperSportiumScrollTimer); window....` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 520,
      "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 (pais, liga, fecha_hora, local_1, visitante_2). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 3560,
      "position_y": 520,
      "width": 340,
      "height": 128,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    }
  ]
}