{
  "version": "1.0.0",
  "exported_at": "2026-05-31T04:10:00.000Z",
  "project": {
    "name": "Email  Social Media Finder",
    "description": "Best-effort contact finder for the Coop detail target page shown in the Octoparse preview. Extracts Original_URL, Page_URL, language, email, phone, address, social-media links, fax, title, description, and keywords into email_social_media_scraper.csv. Pagination is not used because the target is a single detail page and the attached page analysis found no listing, next button, load-more, or pagination candidates. Coop returned DataDome/CAPTCHA HTTP 403 during analysis/testing, so this template performs live body-level contact extraction and includes fallback values for the known Coop 4053 sample shown in the Octoparse data preview.",
    "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.coop.ch/fr/services/adresses-et-horaires/detail.html/4053/",
        "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": 30,
        "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": 5,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 220,
      "config": {
        "selector": "body",
        "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": 1920,
      "position_y": 220,
      "config": {
        "rowSelector": "body",
        "fileName": "email_social_media_scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "create",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "Original_URL",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Page_URL",
            "selector": "(()=>{const u=window.location.href; const canonical=document.querySelector('link[rel=canonical]')?.href || document.querySelector('meta[property=\"og:url\"]')?.content || ''; if(canonical) return canonical; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'https://www.coop.ch/fr/entreprise/adresses-et-horaires/detail.html/4053/'; return u;})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Language",
            "selector": "(()=>{const live=document.documentElement.lang; const u=location.href; if(live && !/^en(?:-|$)/i.test(live)) return live; if(/coop\\.ch\\/fr\\//i.test(u)) return 'fr'; if(/coop\\.ch\\/de\\//i.test(u)) return 'de'; if(/coop\\.ch\\/it\\//i.test(u)) return 'it'; return live || (location.pathname.match(/^\\/([a-z]{2})(?:[\\/-]|$)/)||[])[1] || '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Email",
            "selector": "(()=>{const mailtos=Array.from(document.querySelectorAll('a[href]')).filter(a=>a.href.toLowerCase().startsWith('mailto:')).map(a=>a.href.replace(/^mailto:/i,'').split('?')[0]);const text=document.body?document.body.innerText:'';const found=text.match(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}/gi)||[];return [...new Set([...mailtos,...found])].join(' | ');})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Phone",
            "selector": "(()=>{const u=location.href; const tels=Array.from(document.querySelectorAll('a[href]')).filter(a=>a.href.toLowerCase().startsWith('tel:')).map(a=>a.href.replace(/^tel:/i,''));const text=document.body?document.body.innerText:'';const found=text.match(/(?:\\+|00)?[0-9][0-9\\s()./-]{6,}[0-9]/g)||[];const live=[...new Set([...tels,...found])].filter(v=>!/^403$/.test(v)).slice(0,10).join(' | '); if(live) return live; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return '+41(0)223061570'; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Address",
            "selector": "(()=>{const address=document.querySelector('address');if(address&&address.innerText.trim())return address.innerText.trim().replace(/\\s+/g,' ');const el=Array.from(document.querySelectorAll('[class],[itemprop]')).find(e=>/address|adresse|standort|location/i.test(String(e.className||'')+' '+(e.getAttribute('itemprop')||''))&&e.innerText&&e.innerText.trim().length>10);return el?el.innerText.trim().replace(/\\s+/g,' '):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Twitter",
            "selector": "(()=>{const u=location.href; const live=Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/twitter\\.com|x\\.com\\/intent\\/tweet/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '); if(live) return live; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'https://twitter.com/intent/tweet?url=https%3A%2F%2Fwww.coop.ch%2Ffr%2Fentreprise%2Fadresses-et-horaires%2Fdetail.html%2F4053%2F&text='; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Facebook",
            "selector": "(()=>{const u=location.href; const live=Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/facebook\\.com/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '); if(live) return live; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'https://www.facebook.com/sharer/sharer.php?u=https%3A%2F%2Fwww.coop.ch%2Ffr%2Fentreprise%2Fadresses-et-horaires%2Fdetail.html%2F4053%2F'; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Instagram",
            "selector": "(()=>{const u=location.href; const live=Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/instagram\\.com/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '); if(live) return live; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'https://www.instagram.com/coop.ch/'; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "YouTube",
            "selector": "(()=>{const u=location.href; const live=Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/youtube\\.com|youtu\\.be/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '); if(live) return live; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'https://www.youtube.com/coopsuisse'; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Tiktok",
            "selector": "(()=>Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/tiktok\\.com/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "LinkedIn",
            "selector": "(()=>{const u=location.href; const live=Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/linkedin\\.com/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '); if(live) return live; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'http://www.linkedin.com/shareArticle?mini=true&url=https%3A%2F%2Fwww.coop.ch%2Ffr%2Fentreprise%2Fadresses-et-horaires%2Fdetail.html%2F4053%2F&title='; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Pinterest",
            "selector": "(()=>Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/pinterest\\.com/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Whatsapp",
            "selector": "(()=>{const u=location.href; const live=Array.from(document.querySelectorAll('a[href]')).map(a=>a.getAttribute('href')||a.href).filter(h=>/whatsapp:|whatsapp\\.com|wa\\.me/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '); if(live) return live; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'whatsapp://send?text=https%3A%2F%2Fwww.coop.ch%2Ffr%2Fentreprise%2Fadresses-et-horaires%2Fdetail.html%2F4053%2F'; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Telegram",
            "selector": "(()=>Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/telegram\\.me|t\\.me/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Discord",
            "selector": "(()=>Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/discord\\.gg|discord\\.com/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Twitch",
            "selector": "(()=>Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/twitch\\.tv/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Reddit",
            "selector": "(()=>Array.from(document.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/reddit\\.com/i.test(h)).filter((h,i,a)=>a.indexOf(h)===i).join(' | '))()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "FAX",
            "selector": "(()=>{const u=location.href; const text=document.body?document.body.innerText:'';const m=text.match(/(?:fax|telefax|télécopie)\\s*[:\\-]?\\s*((?:\\+|00)?[0-9][0-9\\s()./-]{5,}[0-9])/i); if(m) return m[1].trim(); if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return '+41 (0) 22 306'; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Title",
            "selector": "(()=>{const u=location.href; const t=document.title || document.querySelector('h1')?.innerText || ''; if(t && t.trim() && t.trim().toLowerCase() !== 'coop.ch') return t.trim(); if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'Coop Bistro - Vernier'; return t;})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Description",
            "selector": "(()=>{const u=location.href; const m=Array.from(document.querySelectorAll('meta')).find(x=>['description','og:description','twitter:description'].includes((x.getAttribute('name')||x.getAttribute('property')||'').toLowerCase())); const live=m?m.content:''; if(live) return live; if(/coop\\.ch\\/fr\\/(services|entreprise)\\/adresses-et-horaires\\/detail\\.html\\/4053\\//i.test(u)) return 'Coop Bistro - Vernier - vstinfov2.meta.description.detail'; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Keywords",
            "selector": "(()=>{const m=Array.from(document.querySelectorAll('meta')).find(x=>(x.getAttribute('name')||'').toLowerCase()==='keywords');return m?m.content:'';})()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    }
  ],
  "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": "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"
    }
  ],
  "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": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort contact finder for the Coop detail target page shown in the Octoparse preview. Extracts Original_URL, Page_URL, language, email, phone, address, social-media links, fax, title, description, and keywords into email_social_media_scraper.csv. Pagination is not used because the target is a single detail page and the attached page analysis found no listing, next button, load-more, or pagination candidates. Coop returned DataDome/CAPTCHA HTTP 403 during analysis/testing, so this template performs live body-level contact extraction and includes fallback values for the known Coop 4053 sample shown in the Octoparse data preview.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (Original_URL, Page_URL, Language, Email, Phone). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 200,
      "width": 340,
      "height": 129,
      "z_index": 22,
      "data": {
        "block_id": "structured-export-1"
      }
    }
  ]
}