{
  "version": "1.0.0",
  "exported_at": "2026-06-03T18:40:00.000Z",
  "project": {
    "name": "Kompass annuaire des entreprises Scraper dÃtail",
    "description": "Bulk Kompass company detail scraper equivalent to the Octoparse Kompass detail template. Processes all provided fr.kompass.com company detail URLs with navigate.urls + loop-continue and appends one CSV row per accessible company page. Extracts URL_entrée, Nom, Lieu, Pays, Téléphone, Présentation, Site, Nature, Création, Forme_juridique, Activité, Capital, SIREN, SIRET, TVA, Effectifs_adresse, and Effectifs_entreprise. Uses self-contained JavaScript columns instead of a shared injected helper, and skips URLs blocked by DataDome/captcha-delivery.",
    "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://fr.kompass.com/c/solsi-cad/fr0330897/",
          "https://fr.kompass.com/c/ipo-technologie/fr8380178/",
          "https://fr.kompass.com/c/transvalor/fr8522895/",
          "https://fr.kompass.com/c/le-sur-mesure-industriel/fr0026795/",
          "https://fr.kompass.com/c/cordons-electriques-du-vercors/fr0665380/"
        ],
        "color": "bg-[#4589ff]",
        "tags": [
          "kompass",
          "bulk-detail-urls"
        ]
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 456,
      "position_y": 220,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "selector": "iframe[src*='captcha-delivery.com'], script[src*='captcha-delivery.com'], iframe[title*='DataDome']",
        "color": "bg-[#ff832b]"
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1464,
      "position_y": 520,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1128,
      "position_y": 520,
      "config": {
        "selector": "body",
        "timeout": 20,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1632,
      "position_y": 800,
      "config": {
        "rowSelector": "body",
        "fileName": "kompass_annuaire_des_entreprises_scraper_detail.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "URL_entrée",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Nom",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var e=document.querySelector('h1,[itemprop=name]');var v=c(e&&(e.innerText||e.textContent));if(!v){var m=document.querySelector('meta[property=\"og:title\"],meta[name=\"title\"]');v=c(m&&m.getAttribute('content'));}v=v.replace(/\\s*-\\s*Kompass.*$/i,'');if(v.indexOf('•')>-1){v=v.split('•')[0];}v=v.replace(/\\s+,\\s*[^,]+$/,'');return c(v);})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Lieu",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var b=document.body.innerText||'';var m=b.match(/-\\s*(\\d{5})\\s+([^-\\n]+?)\\s*-\\s*France/i);if(m){return c(m[2]+' '+m[1]);}m=b.match(/\\b(\\d{5})\\s+([A-Z][A-Z0-9' -]{2,})\\b/);if(m){return c(m[2]+' '+m[1]);}var city=document.querySelector('[itemprop=addressLocality]');var pc=document.querySelector('[itemprop=postalCode]');return c((city&&city.textContent||'')+' '+(pc&&pc.textContent||''));})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Pays",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var e=document.querySelector('[itemprop=addressCountry]');return c(e&&(e.innerText||e.textContent))||'France';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Téléphone",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var e=document.querySelector('a[href^=\"tel:\"]');if(e){return c(e.innerText||e.textContent||e.href.replace(/^tel:/,''));}var m=(document.body.innerText||'').match(/\\+\\d{1,3}[\\s().-]*(?:\\d[\\s().-]*){8,}/);return m?c(m[0]):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Présentation",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var qs=['[itemprop=description]','.description','.presentation','.company-description'];for(var i=0;i<qs.length;i++){var e=document.querySelector(qs[i]);var v=c(e&&(e.innerText||e.textContent));if(v&&v.length>80&&!/cookie|captcha|datadome/i.test(v)){return v;}}var m=document.querySelector('meta[name=\"description\"]');var md=c(m&&m.getAttribute('content'));if(md&&md.length>80){return md;}var a=(document.body.innerText||'').split(/\\n+/);for(i=0;i<a.length;i++){var line=c(a[i]);if(line.length>180&&!/cookie|captcha|datadome|conditions/i.test(line)){return line;}}return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Site",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var a=document.querySelectorAll('a[href^=\"http\"]');var bad=/kompass\\.com|ksales\\.ai|captcha-delivery\\.com|datadome|google\\.|facebook\\.|linkedin\\.|twitter\\.|youtube\\.|cookiedatabase\\.org/i;var fallback='';for(var i=0;i<a.length;i++){var h=a[i].href;if(!h||bad.test(h)){continue;}var t=c((a[i].innerText||a[i].textContent||'')+' '+h).toLowerCase();if(t.indexOf('site')>-1||t.indexOf('internet')>-1||t.indexOf('web')>-1||h.indexOf('www.')>-1){return h;}if(!fallback){fallback=h;}}return fallback;})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Nature",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}function val(labels){var a=(document.body.innerText||'').split(/\\n+/);for(var i=0;i<a.length;i++){var line=c(a[i]);for(var j=0;j<labels.length;j++){var lab=labels[j];if(line.toLowerCase().indexOf(lab.toLowerCase())===0){var v=c(line.substring(lab.length).replace(/^[:：\\s-]+/,''));if(v){return v;}for(var k=i+1;k<a.length&&k<i+6;k++){v=c(a[k]);if(v&&!/^(informations|localisation|autres classifications)/i.test(v)){return v;}}}}}return '';}return val(['Nature','Type établissement','Type etablissement','Nature établissement','Nature etablissement']);})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Création",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var b=document.body.innerText||'';var m=b.match(/(?:Année de création|Annee de creation|Création|Creation)\\s*[:：-]?\\s*(\\d{4})/i);return m?c(m[1]):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Forme_juridique",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}function val(labels){var a=(document.body.innerText||'').split(/\\n+/);for(var i=0;i<a.length;i++){var line=c(a[i]);for(var j=0;j<labels.length;j++){var lab=labels[j];if(line.toLowerCase().indexOf(lab.toLowerCase())===0){var v=c(line.substring(lab.length).replace(/^[:：\\s-]+/,''));if(v){return v;}if(a[i+1]){return c(a[i+1]);}}}}return '';}return val(['Forme juridique','Statut juridique']);})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Activité",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var a=(document.body.innerText||'').split(/\\n+/);for(var i=0;i<a.length;i++){var line=c(a[i]);if(/\\([0-9]{4}[A-Z]\\)/.test(line)){return c(line.replace(/^(Activités \\(NAF08\\)|Activites \\(NAF08\\)|Activité principale|Activite principale|Activité|Activite)\\s*[:：-]?\\s*/i,''));}}return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Capital",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var b=document.body.innerText||'';var m=b.match(/Capital(?: social)?\\s*[:：-]?\\s*([0-9\\s.,]+\\s*(?:EUR|€))/i);return m?c(m[1]):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "SIREN",
            "selector": "(function(){var b=document.body.innerText||'';var m=b.match(/SIREN\\s*[:：-]?\\s*(\\d{3}\\s\\d{3}\\s\\d{3})/i)||b.match(/\\b\\d{3}\\s\\d{3}\\s\\d{3}\\b/);return m?m[1]||m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "SIRET",
            "selector": "(function(){var b=document.body.innerText||'';var m=b.match(/SIRET(?:\\s*\\([^)]*\\))?\\s*[:：-]?\\s*(\\d{3}\\s\\d{3}\\s\\d{3}\\s\\d{5})/i)||b.match(/\\b\\d{3}\\s\\d{3}\\s\\d{3}\\s\\d{5}\\b/);return m?m[1]||m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "TVA",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var b=document.body.innerText||'';var m=b.match(/\\bFR[0-9A-Z]{2}\\s?\\d{9}\\b/i);return m?c(m[0].toUpperCase().replace(/(FR[0-9A-Z]{2})(\\d{9})/,'$1 $2')):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Effectifs_adresse",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var b=document.body.innerText||'';var m=b.match(/Effectifs?\\s+(?:à|a)\\s+l[’']?adresse\\s*[:：-]?\\s*([^\\n]+)/i)||b.match(/Effectifs?\\s+adresse\\s*[:：-]?\\s*([^\\n]+)/i);return m?c(m[1]):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Effectifs_entreprise",
            "selector": "(function(){function c(s){return (s||'').replace(/\\s+/g,' ').trim();}var b=document.body.innerText||'';var m=b.match(/Effectifs?\\s+de\\s+l[’']?entreprise\\s*[:：-]?\\s*([^\\n]+)/i)||b.match(/Effectifs?\\s+entreprise\\s*[:：-]?\\s*([^\\n]+)/i);return m?c(m[1]):'';})()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-2",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1968,
      "position_y": 800,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "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": "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": "loop-continue-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": "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": "loop-continue-2",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 116,
      "width": 1328,
      "height": 596,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 1056,
      "position_y": 116,
      "width": 1160,
      "height": 876,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "loop-continue-1",
          "loop-continue-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1560,
      "position_y": 696,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Bulk Kompass company detail scraper equivalent to the Octoparse Kompass detail template. Processes all provided fr.kompass.com company detail URLs with navigate.urls + loop-continue and appends one CSV row per accessible company page. Extracts URL_entrée, Nom, Lieu, Pays, Téléphone, Présentation, Site, Nature, Création, Forme_juridique, Activité, Capital, SIREN, SIRET, TVA, Effectifs_adresse, and Effectifs_entreprise. Uses self-contained JavaScript columns instead of a shared injected helper, and skips URLs blocked by DataDome/captcha-delivery.",
      "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 `iframe[src*='captcha-delivery.com'], script[src*='captcha-delivery.com'], iframe[title*='DataDome']`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1328,
      "position_y": 200,
      "width": 340,
      "height": 163,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-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": 1664,
      "position_y": 500,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (URL_entrée, Nom, Lieu, Pays, Téléphone). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1832,
      "position_y": 780,
      "width": 340,
      "height": 126,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    },
    {
      "id": "note-block-loop-continue-2",
      "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": 2168,
      "position_y": 780,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-2"
      }
    }
  ]
}