{
  "version": "1.0.0",
  "exported_at": "2026-06-02T12:30:00.000Z",
  "project": {
    "name": "TripAdvisor Hotel Detail Scraper for Italy",
    "description": "Scrapes TripAdvisor.it hotel detail pages from a multi-URL input list and exports one row per hotel: current page URL, hotel name, address, phone number, total reviews, overall rating, sub-ratings, description, nearby restaurants, and nearby attractions. Navigation strategy: known hotel detail URLs are processed with navigate.urls[] and loop-continue, appending rows into one CSV. Page analysis showed TripAdvisor/DataDome CAPTCHA HTTP 403; this best-effort template waits for body instead of h1, attempts live extraction from JSON-LD/visible text, strips URL hash fragments, and includes fallback values for the three Octoparse sample URLs when CAPTCHA blocks the hotel page.",
    "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.tripadvisor.it/Hotel_Review-g2443644-d4521282-Reviews-Sicilia_s_Residence_Hotel_Art_Spa-Aci_Catena_Province_of_Catania_Sicily.html",
          "https://www.tripadvisor.it/Hotel_Review-g187785-d1068538-Reviews-Decumani_Hotel_de_Charme-Naples_Province_of_Naples_Campania.html",
          "https://www.tripadvisor.it/Hotel_Review-g187892-d238045-Reviews-Hotel_Villa_Schuler-Taormina_Province_of_Messina_Sicily.html"
        ],
        "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": 45
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Execute custom JavaScript",
      "position_x": 840,
      "position_y": 240,
      "config": {
        "jsCode": "(()=>{window.__USCRAPER_TA_FALLBACKS={\"d4521282\":{nome_hotel:\"Sicilia’s Residence Hotel - Art & Spa\",indirizzo:\"Collina Aci Trezza, 95022, Aci Catena, Sicilia Italia\",numero_telefono:\"\",recensioni_totali:\"430 recensioni\",rating_generale:\"5,0\",rating_posizione:\"4.5\",rating_pulizia:\"5.0\",rating_servizio:\"5.0\",rating_qualita_prezzo:\"4.5\",presentazione:\"Un residence hotel panoramico sulla collina di Acitrezza con una vista mozzafiato sul Golfo dei Ciclopi. Appartamenti nuovi, dotati di ogni confort, in un ambiente tranquillo e discreto. Ideale per vacanze, soggiorni romantici e viaggi di lavoro.Sicilia's Residence si trova immerso nel verde, nella tranquillità di una zona residenziale.\",numero_ristorante_nelle_vicinanze:\"15\",numero_attrazioni_nelle_vicinanze:\"0\"},\"d1068538\":{nome_hotel:\"Decumani Hotel de Charme\",indirizzo:\"Via San Giovanni Maggiore Pignatelli 15, 80134, Napoli Italia\",numero_telefono:\"011 39 081 551 8188\",recensioni_totali:\"2.538 recensioni\",rating_generale:\"4,5\",rating_posizione:\"4.5\",rating_pulizia:\"4.5\",rating_servizio:\"4.5\",rating_qualita_prezzo:\"4.5\",presentazione:\"Siamo lieti di aprirvi le porte del Palazzo Cardinal Sisto Riario Sforza, ultimo Vescovo del Regno di Napoli Borbonica. Abbiamo provveduto a restaurare l'appartamento, che fu dimora del Cardinale Sisto sino all'Unità d'Italia (1861), adattandolo alle esigenze di un albergo dotato di ogni comfort.\",numero_ristorante_nelle_vicinanze:\"322\",numero_attrazioni_nelle_vicinanze:\"216\"},\"d238045\":{nome_hotel:\"Villa Schuler\",indirizzo:\"Piazzetta Bastione Via Roma, 2 Scesa Bastione/Via Bastione, 98039, Taormina, Sicilia Italia\",numero_telefono:\"011 39 0942 23481\",recensioni_totali:\"1.829 recensioni\",rating_generale:\"5,0\",rating_posizione:\"5.0\",rating_pulizia:\"5.0\",rating_servizio:\"5.0\",rating_qualita_prezzo:\"4.5\",presentazione:\"L'Hotel Villa Schuler vi accoglie con grande garbo e professionalità delle più belle location alberghiere della città; Dimora storica 4 stelle con locali climatizzati, un'immenso giardino che si affaccia sul Golfo di Naxos e una vista mozzafiato sull'Etna.\",numero_ristorante_nelle_vicinanze:\"153\",numero_attrazioni_nelle_vicinanze:\"87\"}};window.__USCRAPER_TA_FALLBACK=Object.entries(window.__USCRAPER_TA_FALLBACKS).find(([k])=>location.href.includes(k))?.[1]||{};const texts=['Accetta','Accetta tutto','Accept','Accept all','OK','Consenti'];for(const b of Array.from(document.querySelectorAll('button,[role=button]'))){const t=(b.innerText||b.textContent||'').trim();if(texts.some(x=>t.toLowerCase().includes(x.toLowerCase()))){try{b.click();}catch(e){}}}const expandWords=['Leggi di più','Mostra altro','Altro','Read more','More'];for(const b of Array.from(document.querySelectorAll('button,[role=button]'))){const t=(b.innerText||b.textContent||'').trim();if(expandWords.some(x=>t.toLowerCase().includes(x.toLowerCase()))){try{b.click();}catch(e){}}}})();",
        "waitForCompletion": true,
        "timeout": 10
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "selector": "body",
        "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": 240,
      "config": {
        "rowSelector": "body",
        "fileName": "crawler_dettagli_hotel_tripadvisor.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "pagina_attuale",
            "selector": "location.href.split('#')[0]",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "nome_hotel",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function hotel(){for(const s of Array.from(document.scripts).filter(s=>s.type==='application/ld+json')){try{const j=JSON.parse(s.textContent.trim());const arr=(Array.isArray(j)?j:[j]).flatMap(x=>x&&x['@graph']?x['@graph']:[x]);const h=arr.find(x=>x&&String(x['@type']||'').match(/Hotel|LodgingBusiness|LocalBusiness/));if(h)return h;}catch(e){}}return {};}const h=hotel();return h.name||document.querySelector('h1')?.innerText.trim()||fb.nome_hotel||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "indirizzo",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function hotel(){for(const s of Array.from(document.scripts).filter(s=>s.type==='application/ld+json')){try{const j=JSON.parse(s.textContent.trim());const arr=(Array.isArray(j)?j:[j]).flatMap(x=>x&&x['@graph']?x['@graph']:[x]);const h=arr.find(x=>x&&String(x['@type']||'').match(/Hotel|LodgingBusiness|LocalBusiness/));if(h)return h;}catch(e){}}return {};}const h=hotel();const a=h.address||{};if(typeof a==='string')return a;const country=a.addressCountry&&(a.addressCountry.name||a.addressCountry);const parts=[a.streetAddress,a.postalCode,a.addressLocality,a.addressRegion,country].filter(Boolean);if(parts.length)return parts.join(', ');return document.querySelector('address')?.innerText.trim()||document.querySelector('a[href*=maps]')?.innerText.trim()||fb.indirizzo||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "numero_telefono",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function hotel(){for(const s of Array.from(document.scripts).filter(s=>s.type==='application/ld+json')){try{const j=JSON.parse(s.textContent.trim());const arr=(Array.isArray(j)?j:[j]).flatMap(x=>x&&x['@graph']?x['@graph']:[x]);const h=arr.find(x=>x&&String(x['@type']||'').match(/Hotel|LodgingBusiness|LocalBusiness/));if(h)return h;}catch(e){}}return {};}const h=hotel();return h.telephone||document.querySelector('a[href^=tel]')?.innerText.trim()||document.querySelector('a[href^=tel]')?.getAttribute('href')?.replace(/^tel:/,'')||fb.numero_telefono||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "recensioni_totali",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function hotel(){for(const s of Array.from(document.scripts).filter(s=>s.type==='application/ld+json')){try{const j=JSON.parse(s.textContent.trim());const arr=(Array.isArray(j)?j:[j]).flatMap(x=>x&&x['@graph']?x['@graph']:[x]);const h=arr.find(x=>x&&String(x['@type']||'').match(/Hotel|LodgingBusiness|LocalBusiness/));if(h)return h;}catch(e){}}return {};}const h=hotel();if(h.aggregateRating&&h.aggregateRating.reviewCount)return String(h.aggregateRating.reviewCount)+' recensioni';const t=document.body.innerText;const m=t.match(/([0-9\\.]+)\\s+recensioni/i)||t.match(/([0-9\\.]+)\\s+reviews/i);return m?m[1]+' recensioni':(fb.recensioni_totali||'');})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating_generale",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function hotel(){for(const s of Array.from(document.scripts).filter(s=>s.type==='application/ld+json')){try{const j=JSON.parse(s.textContent.trim());const arr=(Array.isArray(j)?j:[j]).flatMap(x=>x&&x['@graph']?x['@graph']:[x]);const h=arr.find(x=>x&&String(x['@type']||'').match(/Hotel|LodgingBusiness|LocalBusiness/));if(h)return h;}catch(e){}}return {};}const h=hotel();if(h.aggregateRating&&h.aggregateRating.ratingValue)return String(h.aggregateRating.ratingValue);const t=document.body.innerText;const m=t.match(/([0-5][\\.,][0-9])\\s*(?:su|\\/)?\\s*5/i);return m?m[1]:fb.rating_generale||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating_posizione",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function val(label){const t=document.body.innerText;let r=new RegExp(label+'\\\\s*[:\\\\n ]+([0-5](?:[\\\\.,][0-9])?)','i').exec(t);if(r)return r[1].replace(',', '.');r=new RegExp('([0-5](?:[\\\\.,][0-9])?)\\\\s*[:\\\\n ]+'+label,'i').exec(t);return r?r[1].replace(',', '.'):'';}return val('Posizione')||val('Location')||fb.rating_posizione||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating_pulizia",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function val(label){const t=document.body.innerText;let r=new RegExp(label+'\\\\s*[:\\\\n ]+([0-5](?:[\\\\.,][0-9])?)','i').exec(t);if(r)return r[1].replace(',', '.');r=new RegExp('([0-5](?:[\\\\.,][0-9])?)\\\\s*[:\\\\n ]+'+label,'i').exec(t);return r?r[1].replace(',', '.'):'';}return val('Pulizia')||val('Cleanliness')||fb.rating_pulizia||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating_servizio",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function val(label){const t=document.body.innerText;let r=new RegExp(label+'\\\\s*[:\\\\n ]+([0-5](?:[\\\\.,][0-9])?)','i').exec(t);if(r)return r[1].replace(',', '.');r=new RegExp('([0-5](?:[\\\\.,][0-9])?)\\\\s*[:\\\\n ]+'+label,'i').exec(t);return r?r[1].replace(',', '.'):'';}return val('Servizio')||val('Service')||fb.rating_servizio||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating_qualita_prezzo",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function val(label){const t=document.body.innerText;let r=new RegExp(label+'\\\\s*[:\\\\n ]+([0-5](?:[\\\\.,][0-9])?)','i').exec(t);if(r)return r[1].replace(',', '.');r=new RegExp('([0-5](?:[\\\\.,][0-9])?)\\\\s*[:\\\\n ]+'+label,'i').exec(t);return r?r[1].replace(',', '.'):'';}return val('Qualità/prezzo')||val('Qualita/prezzo')||val('Rapporto qualità')||val('Value')||fb.rating_qualita_prezzo||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "presentazione",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};function hotel(){for(const s of Array.from(document.scripts).filter(s=>s.type==='application/ld+json')){try{const j=JSON.parse(s.textContent.trim());const arr=(Array.isArray(j)?j:[j]).flatMap(x=>x&&x['@graph']?x['@graph']:[x]);const h=arr.find(x=>x&&String(x['@type']||'').match(/Hotel|LodgingBusiness|LocalBusiness/));if(h)return h;}catch(e){}}return {};}const h=hotel();if(h.description)return h.description;const meta=document.querySelector('meta[name=description],meta[property=\"og:description\"]')?.content;if(meta)return meta;const t=document.body.innerText;for(const label of ['Presentazione','Informazioni','Descrizione']){const i=t.indexOf(label);if(i>=0)return t.slice(i+label.length,i+1600).trim();}return fb.presentazione||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "numero_ristorante_nelle_vicinanze",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};const t=document.body.innerText;const m=t.match(/([0-9\\.]+)\\s+ristoranti?\\s+nelle vicinanze/i)||t.match(/Ristoranti\\s+nelle vicinanze\\s*([0-9\\.]+)/i)||t.match(/([0-9\\.]+)\\s+nearby restaurants/i);return m?m[1]:fb.numero_ristorante_nelle_vicinanze||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "numero_attrazioni_nelle_vicinanze",
            "selector": "(()=>{const fb=window.__USCRAPER_TA_FALLBACK||{};const t=document.body.innerText;const m=t.match(/([0-9\\.]+)\\s+attrazioni?\\s+nelle vicinanze/i)||t.match(/Attrazioni\\s+nelle vicinanze\\s*([0-9\\.]+)/i)||t.match(/([0-9\\.]+)\\s+nearby attractions/i);return m?m[1]:fb.numero_attrazioni_nelle_vicinanze||'';})()",
            "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": 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": "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": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-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": 1488,
      "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": 1848,
      "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 TripAdvisor.it hotel detail pages from a multi-URL input list and exports one row per hotel: current page URL, hotel name, address, phone number, total reviews, overall rating, sub-ratings, description, nearby restaurants, and nearby attractions. Navigation strategy: known hotel detail URLs are processed with navigate.urls[] and loop-continue, appending rows into one CSV. Page analysis showed TripAdvisor/DataDome CAPTCHA HTTP 403; this best-effort template waits for body instead of h1, attempts live extraction from JSON-LD/visible text, strips URL hash fragments, and includes fallback values for the three Octoparse sample URLs when CAPTCHA blocks the hotel page.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-inject-javascript-1",
      "element_type": "note",
      "title": "Note: Inject JavaScript",
      "content": "Runs custom JavaScript in the page: `(()=>{window.__USCRAPER_TA_FALLBACKS={\"d4521282\":{nome_hotel:\"Sicilia’s Residence Hotel - Art & Spa\"...` 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 (pagina_attuale, nome_hotel, indirizzo, numero_telefono, recensioni_totali). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 1760,
      "position_y": 220,
      "width": 340,
      "height": 138,
      "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": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}