{
  "version": "1.0.0",
  "exported_at": "2026-06-03T17:00:00.000Z",
  "project": {
    "name": "civitatis details scraper",
    "description": "Scrapes Civitatis activity detail pages and exports the same detail fields shown in the Octoparse preview: original URL, activity name, rating, reviews, price, first three image URLs, description, duration, language, included items, and not-included items. Detail pages do not expose pagination; this template processes multiple provided activity URLs using navigate.urls[] plus loop-continue and appends all results to one CSV. Replace or extend the URL list in the Navigate block for your own Civitatis activity 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": 240,
      "config": {
        "urls": [
          "https://www.civitatis.com/es/milan/excursion-como-bellagio-madonna-ghisallo/",
          "https://www.civitatis.com/es/milan/excursion-lago-como-lugano-bellagio/",
          "https://www.civitatis.com/es/milan/excursion-cinque-terre/",
          "https://www.civitatis.com/es/milan/free-tour-milan-desconocida/",
          "https://www.civitatis.com/es/londres/excursion-stonehenge-castillo-windsor-oxford/",
          "https://www.civitatis.com/es/londres/tour-privado-londres/",
          "https://www.civitatis.com/es/londres/excursion-tren-estudios-harry-potter/"
        ],
        "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": 240,
      "config": {
        "timeout": 30
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 840,
      "position_y": 240,
      "config": {
        "jsCode": "(() => { const candidates = Array.from(document.querySelectorAll('button,a,[role=\"button\"],input[type=\"button\"],input[type=\"submit\"]')); const consent = candidates.find(el => { const t = (el.innerText || el.value || el.getAttribute('aria-label') || el.title || '').trim().toLowerCase(); return t === 'accept' || t === 'aceptar' || t === 'accept all' || t === 'aceptar todo' || t === 'aceptar todas' || t.includes('accept') || t.includes('aceptar'); }); if (consent) { consent.click(); return true; } return false; })()",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "duration": 1
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "selector": "article[itemtype=\"http://schema.org/Product\"] h1.a-title-activity",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "rowSelector": "article[itemtype=\"http://schema.org/Product\"]",
        "fileName": "civitatis-details-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "Original_URL",
            "selector": "window.location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Actividad",
            "selector": "(() => { const el = ROW.querySelector('h1[itemprop=\"name\"], h1.a-title-activity'); return (el ? el.textContent : '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "puntuacion",
            "selector": "(() => { const el = ROW.querySelector('#rating-activity-view, .o-rating__title a'); return (el ? el.textContent : '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "opiniones",
            "selector": "(() => { const el = ROW.querySelector('#rating-opinion-activity-view'); return (el ? el.textContent : '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Precio",
            "selector": "(() => { const el = ROW.querySelector('#js-dynamic-price-container .a-text--price--big, .m-activity-price__text, #ssr-price-fallback .m-activity-price__text'); return (el ? el.textContent : '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "imagen1",
            "selector": "(() => { const imgs = Array.from(ROW.querySelectorAll('meta[itemprop=\"image\"]')).map(m => m.getAttribute('content')).filter(Boolean); return imgs[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "imagen2",
            "selector": "(() => { const imgs = Array.from(ROW.querySelectorAll('meta[itemprop=\"image\"]')).map(m => m.getAttribute('content')).filter(Boolean); return imgs[1] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "imagen3",
            "selector": "(() => { const imgs = Array.from(ROW.querySelectorAll('meta[itemprop=\"image\"]')).map(m => m.getAttribute('content')).filter(Boolean); return imgs[2] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "descripcion",
            "selector": "(() => { const meta = ROW.querySelector('meta[itemprop=\"description\"]'); const val = meta ? meta.getAttribute('content') : ''; return (val || '').replace(/\\u00a0/g, ' ').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "duracion",
            "selector": "(() => { const norm = s => (s || '').normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase().trim(); const h = Array.from(ROW.querySelectorAll('h3')).find(x => norm(x.textContent).startsWith('duracion')); if (!h) return ''; let parts = []; let n = h.nextElementSibling; while (n && !/^H[23]$/.test(n.tagName)) { const txt = (n.innerText || n.textContent || '').trim(); if (txt) parts.push(txt); n = n.nextElementSibling; } if (parts.length) return parts.join('\\n').replace(/[ \\t]+/g, ' ').trim(); const parentText = h.parentElement ? h.parentElement.innerText : ''; return parentText.replace(h.innerText, '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Idioma",
            "selector": "(() => { const norm = s => (s || '').normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase().trim(); const h = Array.from(ROW.querySelectorAll('h3')).find(x => norm(x.textContent).startsWith('idioma')); if (!h) return ''; let parts = []; let n = h.nextElementSibling; while (n && !/^H[23]$/.test(n.tagName)) { const txt = (n.innerText || n.textContent || '').trim(); if (txt) parts.push(txt); n = n.nextElementSibling; } if (parts.length) return parts.join('\\n').replace(/[ \\t]+/g, ' ').trim(); const parentText = h.parentElement ? h.parentElement.innerText : ''; return parentText.replace(h.innerText, '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "Incluido",
            "selector": "(() => { const norm = s => (s || '').normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase().trim(); const h = Array.from(ROW.querySelectorAll('h3')).find(x => norm(x.textContent) === 'incluido' || norm(x.textContent).startsWith('incluido')); if (!h) return ''; let parts = []; let n = h.nextElementSibling; while (n && !/^H[23]$/.test(n.tagName)) { const txt = (n.innerText || n.textContent || '').trim(); if (txt) parts.push(txt); n = n.nextElementSibling; } if (parts.length) return parts.join('\\n').replace(/[ \\t]+/g, ' ').trim(); const parentText = h.parentElement ? h.parentElement.innerText : ''; return parentText.replace(h.innerText, '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "No_incluido",
            "selector": "(() => { const norm = s => (s || '').normalize('NFD').replace(/[\\u0300-\\u036f]/g, '').toLowerCase().trim(); const h = Array.from(ROW.querySelectorAll('h3')).find(x => norm(x.textContent).startsWith('no incluido')); if (!h) return ''; let parts = []; let n = h.nextElementSibling; while (n && !/^H[23]$/.test(n.tagName)) { const txt = (n.innerText || n.textContent || '').trim(); if (txt) parts.push(txt); n = n.nextElementSibling; } if (parts.length) return parts.join('\\n').replace(/[ \\t]+/g, ' ').trim(); const parentText = h.parentElement ? h.parentElement.innerText : ''; return parentText.replace(h.innerText, '').replace(/\\s+/g, ' ').trim(); })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2280,
      "position_y": 240,
      "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": "inject-javascript-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "inject-javascript-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": "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": 136,
      "width": 1760,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 768,
      "position_y": 136,
      "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": 1848,
      "position_y": 136,
      "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": 2208,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Civitatis activity detail pages and exports the same detail fields shown in the Octoparse preview: original URL, activity name, rating, reviews, price, first three image URLs, description, duration, language, included items, and not-included items. Detail pages do not expose pagination; this template processes multiple provided activity URLs using navigate.urls[] plus loop-continue and appends all results to one CSV. Replace or extend the URL list in the Navigate block for your own Civitatis activity 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 7 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 320,
      "position_y": 220,
      "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: `(() => { const candidates = Array.from(document.querySelectorAll('button,a,[role=\"button\"],input[typ...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 220,
      "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 (Original_URL, Actividad, puntuacion, opiniones, Precio). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 220,
      "width": 340,
      "height": 132,
      "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": 2480,
      "position_y": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}