{
  "version": "1.0.0",
  "exported_at": "2026-06-02T23:15:00.000Z",
  "project": {
    "name": "Helpch Leads Scraper",
    "description": "Scrapes Help.ch company lead detail pages and exports company name, street, postal code, city, telephone, fax, and detail URL. Navigation uses a multi-URL loop over Help.ch company profile URLs because the attached analysis covers detail pages and no searchable/paginated listing page was provided; add or replace URLs in the Navigate block for more keyword results.",
    "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": 250,
      "config": {
        "urls": [
          "https://tel.help.ch/f.cfm?key=230591&firma=DIMAB-Groupe&ort=Vionnaz",
          "https://tel.help.ch/f.cfm?key=304127&firma=Autohaus-Wangen-Bei-Olten-AG&ort=Wangen-b.-Olten",
          "https://tel.help.ch/f.cfm?key=23441&firma=Auto-und-Motorradfahrschule-Dieter-Ziganek&ort=Siebnen",
          "https://tel.help.ch/f.cfm?key=140310&firma=Auto-Aarberg&ort=Aarberg",
          "https://tel.help.ch/f.cfm?key=95187&firma=Autofahrschule-Staenz&ort=Wiesendangen",
          "https://tel.help.ch/f.cfm?key=186154&firma=BMW-Finanzdienstleistungen-Schweiz-AG&ort=Dielsdorf",
          "https://tel.help.ch/f.cfm?key=23766&firma=Migros-Genossenschafts-Bund&ort=Zuerich",
          "https://tel.help.ch/f.cfm?key=194276&firma=Genossenschaft-Migros-Vaud&ort=Ecublens"
        ],
        "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": 250,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 840,
      "position_y": 250,
      "config": {
        "selector": "h1",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 250,
      "config": {
        "selector": "address",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1560,
      "position_y": 250,
      "config": {
        "rowSelector": "body",
        "fileName": "help-ch-leads-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "unternehmen",
            "selector": "(() => { const addr = ROW.querySelector('address'); if (addr) { const lines = addr.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); if (lines[0]) return lines[0]; } const h1 = ROW.querySelector('h1')?.innerText.trim() || ''; return h1.replace(/\\s+in\\s+.+$/, '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "strasse",
            "selector": "(() => { const addr = ROW.querySelector('address'); if (!addr) return ''; const lines = addr.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const street = lines.slice(1).find(line => !/^Case postale/i.test(line) && !/^\\d{4}\\b/.test(line) && !/Google Maps/i.test(line) && !/^\\+?\\d[\\d\\s]{7,}$/.test(line)); return street || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "plz",
            "selector": "(() => { const addr = ROW.querySelector('address'); if (!addr) return ''; const plzLink = addr.querySelector('a[href*=\"plzinfo.cfm\"]'); if (plzLink) return plzLink.innerText.trim(); const m = addr.innerText.match(/\\b(\\d{4})\\s+[A-Za-zÄÖÜäöü]/); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "stadt",
            "selector": "(() => { const addr = ROW.querySelector('address'); if (!addr) return ''; const lines = addr.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const plzLine = lines.find(line => /^\\d{4}\\s+/.test(line)); if (plzLine) return plzLine.replace(/^\\d{4}\\s+/, '').replace(/\\s+[A-Z]{2}$/, '').trim(); const plzLink = addr.querySelector('a[href*=\"plzinfo.cfm\"]'); const title = plzLink?.getAttribute('title') || ''; const m = title.match(/Ort\\s+(.+)$/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "telefon",
            "selector": "(() => { const addr = ROW.querySelector('address'); if (!addr) return ''; const lines = addr.innerText.split(/\\n+/).map(s => s.trim()).filter(Boolean); const phoneLine = lines.find(line => /^\\+?\\d[\\d\\s]{7,}$/.test(line)); if (phoneLine) return phoneLine.trim(); const text = ROW.innerText; const m = text.match(/Telefonnummer\\s+(\\+?\\d[\\d\\s]{7,})/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "fax",
            "selector": "(() => { const text = ROW.innerText; const m = text.match(/Faxnummer\\s+(\\+?\\d[\\d\\s]{7,})/i); return m ? m[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "detail_url",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 1920,
      "position_y": 250,
      "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": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-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-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 146,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "wait-for-element-2"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1488,
      "position_y": 146,
      "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": 1848,
      "position_y": 146,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Help.ch company lead detail pages and exports company name, street, postal code, city, telephone, fax, and detail URL. Navigation uses a multi-URL loop over Help.ch company profile URLs because the attached analysis covers detail pages and no searchable/paginated listing page was provided; add or replace URLs in the Navigate block for more keyword results.",
      "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 (unternehmen, strasse, plz, stadt, telefon). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 230,
      "width": 340,
      "height": 127,
      "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": 2120,
      "position_y": 230,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}