{
  "version": "1.0.0",
  "exported_at": "2026-06-01T18:45:00.000Z",
  "project": {
    "name": "Kompass Leads Scraper for Germany",
    "description": "Scrapes Kompass Germany company detail pages by a list of detail-page URLs and exports the same lead fields shown in the Octoparse template: company name, address, country, fax, official website, Kompass ID, membership data, telephone, product images, description, and input URL. Navigation strategy: multi-URL detail-page loop using navigate.urls[] plus loop-continue, with structured-export in append mode. Limitation: de.kompass.com showed a DataDome/CAPTCHA 403 during analysis, so this best-effort template requires a browser session/proxy that can access the real company pages.",
    "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": {
        "urls": [
          "https://de.kompass.com/c/chematek-france/fr4664020/",
          "https://de.kompass.com/c/dixi-polytool-sa/ch013466/",
          "https://de.kompass.com/c/rollier-s-a/ch022086/",
          "https://de.kompass.com/c/mercedes-benz-werk-sindelfingen/de611767/",
          "https://de.kompass.com/c/mercedes-benz-group-ag/de606473/",
          "https://de.kompass.com/c/sonova-retail-deutschland-gmbh/de611732/",
          "https://de.kompass.com/c/mercedes-benz-werk-gaggenau/de611743/"
        ],
        "color": "bg-[#08bdba]"
      }
    },
    {
      "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": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 220,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "jsCode": "(function(){const re=/telefon|fax|kontakt|kontaktdaten|anzeigen|nummer/i; Array.from(document.querySelectorAll('button,a')).slice(0,80).forEach(el=>{const txt=(el.innerText||el.textContent||el.getAttribute('aria-label')||'').trim(); const href=el.getAttribute('href')||''; if(re.test(txt) && !/^https?:\\/\\//i.test(href)){try{el.click()}catch(e){}}}); return true;})()",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1920,
      "position_y": 220,
      "config": {
        "duration": 2,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "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": "body",
        "fileName": "kompass-leads-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "Name_des_Unternehmens",
            "selector": "(function(){const d=document; const el=d.querySelector('[itemprop=name], .company-name, h1'); if(el&&el.textContent.trim()) return el.textContent.replace(/\\s+/g,' ').trim(); const m=Array.from(d.querySelectorAll('meta')).find(x=>x.getAttribute('property')==='og:title'||x.name==='title'); return m?(m.content||'').replace(/\\s*-\\s*kompass.*$/i,'').trim():''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Adresse",
            "selector": "(function(){const d=document; const org=Array.from(d.querySelectorAll('script[type=\"application/ld+json\"]')).map(s=>{try{return JSON.parse(s.textContent)}catch(e){return null}}).flat().find(o=>o&&o.address); if(org&&org.address){const a=org.address; return typeof a==='string'?a:[a.streetAddress,a.postalCode,a.addressLocality,a.addressRegion].filter(Boolean).join(' ')} const el=d.querySelector('[itemprop=address], [class*=address i], [data-testid*=address i]'); return el?el.textContent.replace(/\\s+/g,' ').trim():''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Land",
            "selector": "(function(){const d=document; const org=Array.from(d.querySelectorAll('script[type=\"application/ld+json\"]')).map(s=>{try{return JSON.parse(s.textContent)}catch(e){return null}}).flat().find(o=>o&&o.address); if(org&&org.address&&org.address.addressCountry)return org.address.addressCountry; const el=d.querySelector('[itemprop=addressCountry], [class*=country i]'); if(el&&el.textContent.trim())return el.textContent.trim(); const t=d.body.innerText; const m=t.match(/\\b(Deutschland|Frankreich|Schweiz|Österreich|Belgien|Niederlande|Italien|Spanien|Vereinigtes Königreich|USA)\\b/i); return m?m[1]:''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Fax",
            "selector": "(function(){const t=document.body.innerText.replace(/\\u00a0/g,' '); const el=document.querySelector('a[href^=fax]'); if(el)return el.href.replace(/^fax:/i,'').trim(); const m=t.match(/Fax\\s*:?\\s*([+()0-9\\-\\s\\/]{6,})/i); return m?m[1].trim():''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Offizielle_Website",
            "selector": "(function(){const d=document; const direct=d.querySelector('[itemprop=url]'); if(direct) return direct.href||direct.textContent.trim(); const a=Array.from(d.querySelectorAll('a[href^=http]')).find(a=>!/kompass\\.com|captcha-delivery\\.com|google|facebook|linkedin|twitter/i.test(a.href)); return a?a.href:''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Kompass_ID",
            "selector": "(function(){const m=location.pathname.match(/\\/([a-z]{2}\\d+)\\/?$/i); if(m)return m[1].toUpperCase(); const t=document.body.innerText; const n=t.match(/\\b([A-Z]{2}\\d{5,})\\b/); return n?n[1]:''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Kompass_Mitglied_seit",
            "selector": "(function(){const t=document.body.innerText.replace(/\\u00a0/g,' '); const m=t.match(/\\+\\s*\\d+\\s*Jahre/i); return m?m[0].replace(/\\s+/g,'').replace('Jahre','Jahre'):''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Name_der_Mitgliedschaft",
            "selector": "(function(){const a=Array.from(document.querySelectorAll('a[href*=solutions]')).find(a=>/booster|premium|mitglied/i.test(a.textContent+a.href)); if(a&&a.textContent.trim())return a.textContent.trim(); const t=document.body.innerText; const m=t.match(/\\b(Booster|Premium Marketing|Premium|Basic)\\b/i); return m?m[1]:''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "URL_der_Mitgliedschaft",
            "selector": "(function(){const a=Array.from(document.querySelectorAll('a[href*=solutions]')).find(a=>/booster|premium|mitglied/i.test(a.textContent+a.href)); return a?a.href:''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Telefon",
            "selector": "(function(){const el=document.querySelector('a[href^=tel]'); if(el)return (el.href||el.textContent).replace(/^tel:/i,'').trim(); const t=document.body.innerText.replace(/\\u00a0/g,' '); const m=t.match(/(?:Telefon|Tel\\.?|Phone)\\s*:?\\s*([+()0-9\\-\\s\\/]{6,})/i); return m?m[1].trim():''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Produkt_image_1",
            "selector": "(function(){return Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/img\\.kompass\\.com/i.test(src))[0]||''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Produkt_image_2",
            "selector": "(function(){return Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/img\\.kompass\\.com/i.test(src))[1]||''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Produkt_image_3",
            "selector": "(function(){return Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/img\\.kompass\\.com/i.test(src))[2]||''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Firmenkurzbeschreibung",
            "selector": "(function(){const d=document; const org=Array.from(d.querySelectorAll('script[type=\"application/ld+json\"]')).map(s=>{try{return JSON.parse(s.textContent)}catch(e){return null}}).flat().find(o=>o&&o.description); if(org&&org.description)return org.description.replace(/\\s+/g,' ').trim(); const el=d.querySelector('[itemprop=description], [class*=description i], [data-testid*=description i], .activity'); if(el)return el.textContent.replace(/\\s+/g,' ').trim(); const t=d.body.innerText.replace(/\\u00a0/g,' '); const m=t.match(/Geschäftstätigkeit\\s*:?\\s*([\\s\\S]{0,2500})/i); return m?m[1].replace(/\\s+/g,' ').trim():''})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Input_url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2640,
      "position_y": 540,
      "config": {
        "color": "bg-[#ff832b]"
      }
    }
  ],
  "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": "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": "loop-continue-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": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1488,
      "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-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 2568,
      "position_y": 436,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Kompass Germany company detail pages by a list of detail-page URLs and exports the same lead fields shown in the Octoparse template: company name, address, country, fax, official website, Kompass ID, membership data, telephone, product images, description, and input URL. Navigation strategy: multi-URL detail-page loop using navigate.urls[] plus loop-continue, with structured-export in append mode. Limitation: de.kompass.com showed a DataDome/CAPTCHA 403 during analysis, so this best-effort template requires a browser session/proxy that can access the real company pages.",
      "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 7 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "position_y": 200,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(function(){const re=/telefon|fax|kontakt|kontaktdaten|anzeigen|nummer/i; Array.from(document.queryS...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1760,
      "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 (Name_des_Unternehmens, Adresse, Land, Fax, Offizielle_Website). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 200,
      "width": 340,
      "height": 134,
      "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": 2840,
      "position_y": 520,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}