{
  "version": "1.0.0",
  "exported_at": "2026-05-31T00:00:00.000Z",
  "project": {
    "name": "Contact Details Scraper",
    "description": "Best-effort public contact-details scraper equivalent to the Octoparse Contact Details Scraper. It loops through supplied target social/profile URLs using navigate.urls[], extracts one contact-summary row per page, and appends results to contact-details-scraper.csv. Fields include URL metadata, emails, phones, uncertain phone-like strings, and clickable social/profile links. This template does not crawl subpages by depth; LinkedIn/X/YouTube may limit data behind login, JavaScript, CAPTCHA, or hidden popups. Uses a non-navigating scroll/DOM-ready step to avoid leaving profile/channel pages.",
    "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": 260,
      "config": {
        "urls": [
          "https://twitter.com/Octoparse",
          "https://www.youtube.com/channel/UCweDWm1QY2G67SDAKX7nreg",
          "https://www.linkedin.com/company/octopus-data-inc"
        ],
        "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": 480,
      "position_y": 260,
      "config": {
        "timeout": 35
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "duration": 3
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript on the page",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "jsCode": "(() => { window.__USCRAPER_PROFILE_URL = window.__USCRAPER_PROFILE_URL || location.href; window.scrollTo(0, Math.min(document.body.scrollHeight, 900)); return { url: location.href, title: document.title, links: document.querySelectorAll('a[href]').length }; })();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "duration": 2
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": false
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2280,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "contact-details-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "start_url",
            "selector": "window.__USCRAPER_PROFILE_URL || location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "domain",
            "selector": "location.hostname.replace(/^www\\./, '')",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "depth",
            "selector": "'0'",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "referrer_url",
            "selector": "document.referrer || (window.__USCRAPER_PROFILE_URL || location.href)",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "emails",
            "selector": "(() => { const text = (ROW.innerText || '') + ' ' + (ROW.innerHTML || ''); const emails = text.match(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}/gi) || []; return [...new Set(emails.map(e => e.replace(/^mailto:/i, '').trim()))].join(';'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "phones",
            "selector": "(() => { const text = ROW.innerText || ''; const strict = text.match(/(?:\\+?\\d{1,3}[\\s.-]?)?(?:\\(?\\d{3}\\)?[\\s.-]?)\\d{3}[\\s.-]?\\d{4}\\b/g) || []; return [...new Set(strict.map(p => p.trim()))].join(';'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "uncertain_phones",
            "selector": "(() => { const text = ROW.innerText || ''; const strict = new Set((text.match(/(?:\\+?\\d{1,3}[\\s.-]?)?(?:\\(?\\d{3}\\)?[\\s.-]?)\\d{3}[\\s.-]?\\d{4}\\b/g) || []).map(p => p.trim())); const loose = text.match(/\\+?\\d[\\d .()-]{8,}\\d/g) || []; return [...new Set(loose.map(p => p.trim()).filter(p => { const digits = p.replace(/\\D/g, ''); return !strict.has(p) && digits.length >= 10 && digits.length <= 15; }))].join(';'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "twitter",
            "selector": "(() => { const reserved = new Set(['login','signup','home','i','intent','search','hashtag','explore','settings','tos','privacy']); const decode = h => { if (!h || h.startsWith('#') || /^javascript:/i.test(h) || /^mailto:|^tel:/i.test(h)) return ''; try { const u = new URL(h, location.href); const q = u.searchParams.get('q') || u.searchParams.get('url'); return q || u.href; } catch(e) { return ''; } }; const hostNow = location.hostname.replace(/^www\\./,'').toLowerCase(); const pathNow = location.pathname.replace(/\\/$/,''); if ((hostNow === 'x.com' || hostNow === 'twitter.com') && /^\\/[A-Za-z0-9_]{1,20}$/.test(pathNow) && !reserved.has(pathNow.slice(1).toLowerCase())) return 'https://x.com/' + pathNow.slice(1); const links = Array.from(document.querySelectorAll('a[href]')).map(a => decode(a.getAttribute('href'))).filter(Boolean); return [...new Set(links.filter(h => { try { const u = new URL(h); const host = u.hostname.replace(/^www\\./,'').toLowerCase(); const p = u.pathname.replace(/\\/$/,''); const name = p.slice(1).toLowerCase(); return (host === 'x.com' || host === 'twitter.com') && /^\\/[A-Za-z0-9_]{1,20}$/.test(p) && !reserved.has(name); } catch(e){ return false; } }))].join(';'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "youtube",
            "selector": "(() => { const decode = h => { if (!h || h.startsWith('#') || /^javascript:/i.test(h) || /^mailto:|^tel:/i.test(h)) return ''; try { const u = new URL(h, location.href); const q = u.searchParams.get('q') || u.searchParams.get('url'); return q || u.href; } catch(e) { return ''; } }; const hostNow = location.hostname.replace(/^www\\./,'').toLowerCase(); const pathNow = location.pathname.replace(/\\/$/,''); if (hostNow === 'youtube.com' && (/^\\/channel\\//.test(pathNow) || /^\\/@/.test(pathNow) || /^\\/c\\//.test(pathNow) || /^\\/user\\//.test(pathNow))) return location.href; const links = Array.from(document.querySelectorAll('a[href]')).map(a => decode(a.getAttribute('href'))).filter(Boolean); return [...new Set(links.filter(h => { try { const u = new URL(h); const host = u.hostname.replace(/^www\\./,'').toLowerCase(); const p = u.pathname.replace(/\\/$/,''); return host === 'youtube.com' && (/^\\/channel\\//.test(p) || /^\\/@/.test(p) || /^\\/c\\//.test(p) || /^\\/user\\//.test(p)); } catch(e){ return false; } }))].join(';'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "facebook",
            "selector": "(() => { const reserved = /\\/(sharer|share|dialog|plugins|login|privacy|terms|help|watch|reel|groups|events)\\b/i; const decode = h => { if (!h || h.startsWith('#') || /^javascript:/i.test(h) || /^mailto:|^tel:/i.test(h)) return ''; try { const u = new URL(h, location.href); const q = u.searchParams.get('q') || u.searchParams.get('url'); return q || u.href; } catch(e) { return ''; } }; const hostNow = location.hostname.replace(/^www\\./,'').toLowerCase(); if ((hostNow === 'facebook.com' || hostNow === 'fb.com') && location.pathname !== '/' && !reserved.test(location.pathname)) return location.href; const links = Array.from(document.querySelectorAll('a[href]')).map(a => decode(a.getAttribute('href'))).filter(Boolean); return [...new Set(links.filter(h => { try { const u = new URL(h); const host = u.hostname.replace(/^www\\./,'').toLowerCase(); const p = u.pathname.replace(/\\/$/,''); return (host === 'facebook.com' || host === 'fb.com') && p && !reserved.test(p); } catch(e){ return false; } }))].join(';'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "linkedin",
            "selector": "(() => { const decode = h => { if (!h || h.startsWith('#') || /^javascript:/i.test(h) || /^mailto:|^tel:/i.test(h)) return ''; try { const u = new URL(h, location.href); const q = u.searchParams.get('q') || u.searchParams.get('url'); return q || u.href; } catch(e) { return ''; } }; const hostNow = location.hostname.replace(/^www\\./,'').toLowerCase(); const pathNow = location.pathname.replace(/\\/$/,''); if (hostNow.endsWith('linkedin.com') && /^\\/(company|in|school)\\/[^\\/]+$/i.test(pathNow)) return location.href; const links = Array.from(document.querySelectorAll('a[href]')).map(a => decode(a.getAttribute('href'))).filter(Boolean); return [...new Set(links.filter(h => { try { const u = new URL(h); const host = u.hostname.replace(/^www\\./,'').toLowerCase(); const p = u.pathname.replace(/\\/$/,''); return host.endsWith('linkedin.com') && /^\\/(company|in|school)\\/[^\\/]+$/i.test(p); } catch(e){ return false; } }))].join(';'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "instagram",
            "selector": "(() => { const reserved = new Set(['p','reel','reels','explore','accounts','about','privacy','terms','developer','directory']); const decode = h => { if (!h || h.startsWith('#') || /^javascript:/i.test(h) || /^mailto:|^tel:/i.test(h)) return ''; try { const u = new URL(h, location.href); const q = u.searchParams.get('q') || u.searchParams.get('url'); return q || u.href; } catch(e) { return ''; } }; const hostNow = location.hostname.replace(/^www\\./,'').toLowerCase(); const pathNow = location.pathname.replace(/\\/$/,''); if (hostNow === 'instagram.com' && /^\\/[A-Za-z0-9._]+$/.test(pathNow) && !reserved.has(pathNow.slice(1).toLowerCase())) return location.href; const links = Array.from(document.querySelectorAll('a[href]')).map(a => decode(a.getAttribute('href'))).filter(Boolean); return [...new Set(links.filter(h => { try { const u = new URL(h); const host = u.hostname.replace(/^www\\./,'').toLowerCase(); const p = u.pathname.replace(/\\/$/,''); const first = p.split('/')[1]?.toLowerCase(); return host === 'instagram.com' && /^\\/[A-Za-z0-9._]+$/.test(p) && !reserved.has(first); } catch(e){ return false; } }))].join(';'); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "tiktok",
            "selector": "(() => { const decode = h => { if (!h || h.startsWith('#') || /^javascript:/i.test(h) || /^mailto:|^tel:/i.test(h)) return ''; try { const u = new URL(h, location.href); const q = u.searchParams.get('q') || u.searchParams.get('url'); return q || u.href; } catch(e) { return ''; } }; const hostNow = location.hostname.replace(/^www\\./,'').toLowerCase(); const pathNow = location.pathname.replace(/\\/$/,''); if (hostNow === 'tiktok.com' && /^\\/@[^\\/]+$/i.test(pathNow)) return location.href; const links = Array.from(document.querySelectorAll('a[href]')).map(a => decode(a.getAttribute('href'))).filter(Boolean); return [...new Set(links.filter(h => { try { const u = new URL(h); const host = u.hostname.replace(/^www\\./,'').toLowerCase(); const p = u.pathname.replace(/\\/$/,''); return host === 'tiktok.com' && /^\\/@[^\\/]+$/i.test(p); } catch(e){ return false; } }))].join(';'); })()",
            "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": 260,
      "config": {}
    }
  ],
  "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": "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": "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-1",
      "to_connector_id": "left"
    }
  ],
  "canvas_elements": [
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 156,
      "width": 2120,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "sleep-2",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1128,
      "position_y": 156,
      "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": 156,
      "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": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort public contact-details scraper equivalent to the Octoparse Contact Details Scraper. It loops through supplied target social/profile URLs using navigate.urls[], extracts one contact-summary row per page, and appends results to contact-details-scraper.csv. Fields include URL metadata, emails, phones, uncertain phone-like strings, and clickable social/profile links. This template does not crawl subpages by depth; LinkedIn/X/YouTube may limit data behind login, JavaScript, CAPTCHA, or hidden popups. Uses a non-navigating scroll/DOM-ready step to avoid leaving profile/channel 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 3 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 320,
      "position_y": 240,
      "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: `(() => { window.__USCRAPER_PROFILE_URL = window.__USCRAPER_PROFILE_URL || location.href; window.scro...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1400,
      "position_y": 240,
      "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 (start_url, domain, depth, referrer_url, current_url). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 240,
      "width": 340,
      "height": 131,
      "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": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}