{
  "version": "1.0.0",
  "exported_at": "2026-06-01T12:00:00.000Z",
  "project": {
    "name": "Austria Herold Scraper",
    "description": "Scrapes Austrian Herold business detail pages from a multi-URL list and exports category/keyword, location, Herold URL, business name, industry, address, opening hours, email, phone, website, Facebook, and YouTube. Navigation uses navigate.urls[] plus loop-continue so multiple supplied Herold listing/detail URLs are processed and appended into one CSV.",
    "color": "bg-[#fec601]",
    "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://www.herold.at/gelbe-seiten/salzburg/8Htk8/airporthotel-salzburg/"
        ],
        "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": 30
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "selector": ".cmpboxbtnyes, .cmptxt_btn_yes"
      }
    },
    {
      "block_id": "click-1",
      "block_type": "process",
      "title": "Click",
      "description": "Click on element",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "selector": ".cmpboxbtnyes, .cmptxt_btn_yes",
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "duration": 1
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1920,
      "position_y": 580,
      "config": {
        "selector": "h1[itemprop=\"name\"], h1",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2280,
      "position_y": 580,
      "config": {
        "rowSelector": "body",
        "fileName": "oesterreich-herold-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "schluesselwort",
            "selector": "(()=>{const d=ROW.ownerDocument;const crumbs=Array.from(d.querySelectorAll('nav[itemprop=\"breadcrumb\"] span[itemprop=\"name\"]')).map(e=>e.textContent.trim()).filter(Boolean);return crumbs[0]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "standort",
            "selector": "(()=>{const d=ROW.ownerDocument;return d.querySelector('[itemprop=\"addressRegion\"]')?.getAttribute('content')||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ergebnis_url",
            "selector": "(()=>{const d=ROW.ownerDocument;return d.querySelector('meta[itemprop=\"url\"][data-yxt=\"web\"]')?.getAttribute('content')||d.location.href;})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "business_name",
            "selector": "(()=>{const d=ROW.ownerDocument;return d.querySelector('h1[itemprop=\"name\"], h1')?.textContent?.trim()||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "branche",
            "selector": "(()=>{const d=ROW.ownerDocument;const crumbs=Array.from(d.querySelectorAll('nav[itemprop=\"breadcrumb\"] span[itemprop=\"name\"]')).map(e=>e.textContent.trim()).filter(Boolean);return crumbs[0]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "adresse_strasse",
            "selector": "(()=>{const d=ROW.ownerDocument;return d.querySelector('[itemprop=\"streetAddress\"]')?.getAttribute('content')||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "plz",
            "selector": "(()=>{const d=ROW.ownerDocument;return d.querySelector('[itemprop=\"postalCode\"]')?.getAttribute('content')||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "adresse_region",
            "selector": "(()=>{const d=ROW.ownerDocument;return d.querySelector('[itemprop=\"addressRegion\"]')?.getAttribute('content')||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "land",
            "selector": "(()=>{const d=ROW.ownerDocument;return d.querySelector('[itemprop=\"addressCountry\"]')?.getAttribute('content')||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "oeffnungszeiten",
            "selector": "(()=>{const d=ROW.ownerDocument;const vals=Array.from(d.querySelectorAll('[itemprop=\"openingHours\"], [itemprop=\"openingHoursSpecification\"]')).map(e=>(e.getAttribute('content')||e.textContent||'').trim()).filter(Boolean);if(vals.length)return vals.join(' | ');const h=Array.from(d.querySelectorAll('h2,h3')).find(e=>/Öffnungszeiten/i.test(e.textContent||''));if(!h)return '';let c=h.closest('article, section, div')||h.parentElement;let txt=(c&&c.textContent||'').replace(/Öffnungszeiten/i,'').replace(/Weitere Kontaktmöglichkeiten[\\s\\S]*/i,'').trim();return txt;})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "email",
            "selector": "(()=>{const d=ROW.ownerDocument;const mail=d.querySelector('a[href^=\"mailto:\"]');if(mail)return (mail.getAttribute('href')||'').replace(/^mailto:/i,'').split('?')[0];const t=d.body.innerText||'';const m=t.match(/[A-Z0-9._%+-]+@[A-Z0-9.-]+\\.[A-Z]{2,}/i);return m?m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "telefon",
            "selector": "(()=>{const d=ROW.ownerDocument;const a=d.querySelector('a[href^=\"tel:\"]');if(a)return (a.textContent||a.getAttribute('href')||'').replace(/^tel:/i,'').trim();const t=d.body.innerText||'';const m=t.match(/\\+43[\\s()0-9\\/.-]{6,}/);return m?m[0].trim():'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "website",
            "selector": "(()=>{const d=ROW.ownerDocument;const links=Array.from(d.querySelectorAll('a[href]')).map(a=>a.href).filter(h=>/^https?:/i.test(h));const w=links.find(h=>!/herold\\.at/i.test(h)&&!/facebook\\.com|youtube\\.com|youtu\\.be|instagram\\.com|linkedin\\.com|twitter\\.com|x\\.com/i.test(h));return w||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "facebook",
            "selector": "(()=>{const d=ROW.ownerDocument;const a=Array.from(d.querySelectorAll('a[href]')).find(a=>/facebook\\.com/i.test(a.href));return a?a.href:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "youtube",
            "selector": "(()=>{const d=ROW.ownerDocument;const a=Array.from(d.querySelectorAll('a[href]')).find(a=>/youtube\\.com|youtu\\.be/i.test(a.href));return a?a.href:'';})()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 2640,
      "position_y": 580,
      "config": {
        "duration": 1
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 3000,
      "position_y": 580,
      "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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "click-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": "click-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"
    },
    {
      "from_block_id": "structured-export-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": "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": 2840,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1",
          "sleep-2"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 768,
      "position_y": 156,
      "width": 2480,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "click-1",
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 2208,
      "position_y": 476,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Austrian Herold business detail pages from a multi-URL list and exports category/keyword, location, Herold URL, business name, industry, address, opening hours, email, phone, website, Facebook, and YouTube. Navigation uses navigate.urls[] plus loop-continue so multiple supplied Herold listing/detail URLs are processed and appended into one CSV.",
      "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 `.cmpboxbtnyes, .cmptxt_btn_yes`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 240,
      "width": 340,
      "height": 140,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (schluesselwort, standort, ergebnis_url, business_name, branche). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2480,
      "position_y": 560,
      "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": 3200,
      "position_y": 560,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}