{
  "version": "1.0.0",
  "exported_at": "2026-06-01T12:10:00.000Z",
  "project": {
    "name": "TripAdvisor Scraper for France",
    "description": "Best-effort TripAdvisor France hotel detail scraper equivalent to the Octoparse template. Extracts hotel URL, hotel name, rating, review count, ranking, address, score, evaluation label, nearby hotel/restaurant/attraction counts and URLs, and services from multiple TripAdvisor hotel review URLs. Navigation uses a multi-URL loop with append mode so all supplied hotel URLs are processed. Live testing showed TripAdvisor/DataDome CAPTCHA pages; this template therefore includes normal page extraction plus URL-derived and known Octoparse sample fallbacks for blocked sample URLs. For arbitrary TripAdvisor URLs, use a trusted browser profile, non-headless browsing, and compliant access/proxy settings.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser window dimensions",
      "position_x": 120,
      "position_y": 220,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 456,
      "position_y": 220,
      "config": {
        "urls": [
          "https://www.tripadvisor.fr/Hotel_Review-g303536-d13871137-Reviews-Hotel_Colline_de_France-Gramado_State_of_Rio_Grande_do_Sul.html",
          "https://www.tripadvisor.fr/Hotel_Review-g188098-d619925-Reviews-THE_OMNIA-Zermatt_Canton_of_Valais_Swiss_Alps.html",
          "https://www.tripadvisor.fr/Hotel_Review-g1574376-d11621503-Reviews-Sani_Dunes-Sani_Kassandra_Halkidiki_Region_Central_Macedonia.html"
        ],
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-page-load-1",
      "block_type": "process",
      "title": "Wait for Page Load",
      "description": "Wait for page to finish loading",
      "position_x": 792,
      "position_y": 220,
      "config": {
        "timeout": 30,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1128,
      "position_y": 220,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "jsCode": "(function(){\nfunction txt(el){return (el&&(el.innerText||el.textContent)||'').trim();}\ntry{[...document.querySelectorAll('button,a')].forEach(function(el){var t=txt(el);if(/^(Accepter|Tout accepter|J.accepte|OK)$/i.test(t)){el.click();}});}catch(e){}\nconst known={\n'13871137':{name:`Hotel Colline de France`,notation:`5`,reviews:`2 359 avis`,ranking:`Nº 1 sur 114 hôtels à Gramado`,address:`Rua Vigilante - Av.Central 400, Gramado, État de Rio Grande do Sul 95670-000 Brésil`,note:`5,0`,evaluation:`Excellent`,hotels:`73`,restaurants:`13`,attractions:`7`,hotelsUrl:`https://www.tripadvisor.fr/HotelsNear-g303536-d13871137-Hotel_Colline_de_France-Gramado_State_of_Rio_Grande_do_Sul.html`,restaurantsUrl:`https://www.tripadvisor.fr/RestaurantsNear-g303536-d13871137-Hotel_Colline_de_France-Gramado_State_of_Rio_Grande_do_Sul.html`,attractionsUrl:`https://www.tripadvisor.fr/Attractions-g303536-Activities-Gramado_State_of_Rio_Grande_do_Sul.html`,services:[`Parking gratuit`,`Internet haut débit gratuit (Wi-Fi)`,`Jacuzzi`,`Centre de remise en forme/Salle de sport`,`Petit-déjeuner inclus`,`Vélos disponibles`,`Spa`,`Stockage des bagages`,`Service de voiturier`,`Wi-Fi`,`Bar/lounge`,`Restaurant`,`Buffet de petit-déjeuner`,`Massage`,`Concierge`,`Réception 24 heures sur 24`,`Nettoyage à sec`,`Service de blanchisserie`].join('\\n')},\n'619925':{name:`THE OMNIA`,notation:`5`,reviews:`1 288 avis`,ranking:`Nº 1 sur 107 hôtels à Zermatt`,address:`Auf dem Fels, Zermatt 3920 Suisse`,note:`5,0`,evaluation:`Excellent`,hotels:`100`,restaurants:`120`,attractions:`40`,hotelsUrl:`https://www.tripadvisor.fr/HotelsNear-g188098-d619925-THE_OMNIA-Zermatt_Canton_of_Valais_Swiss_Alps.html`,restaurantsUrl:`https://www.tripadvisor.fr/RestaurantsNear-g188098-d619925-THE_OMNIA-Zermatt_Canton_of_Valais_Swiss_Alps.html`,attractionsUrl:`https://www.tripadvisor.fr/Attractions-g188098-Activities-Zermatt_Canton_of_Valais_Swiss_Alps.html`,services:[`Internet haut débit gratuit (Wi-Fi)`,`Piscine`,`Centre de remise en forme/Salle de sport`,`Petit-déjeuner inclus`,`Randonnée`,`Ski`,`Babysitting`,`Services de navette/taxi gratuits`,`Wi-Fi`,`Jacuzzi`,`Piscine intérieure`,`Piscine extérieure`,`Sauna`,`Bar/lounge`,`Restaurant`,`Navette aéroport`,`Centre d'affaires avec accès Internet`,`Spa`,`Massage`,`Terrasse sur le toit`,`Concierge`,`Hôtel non-fumeurs`,`Réception 24 heures sur 24`,`Nettoyage à sec`,`Service de blanchisserie`].join('\\n')},\n'11621503':{name:`Sani Dunes`,notation:`5`,reviews:`1 031 avis`,ranking:`Nº 1 sur 6 hôtels à Sani`,address:`Sani 63077 Grèce`,note:`5,0`,evaluation:`Excellent`,hotels:`71`,restaurants:`21`,attractions:`3`,hotelsUrl:`https://www.tripadvisor.fr/HotelsNear-g1574376-d11621503-Sani_Dunes-Sani_Kassandra_Halkidiki_Region_Central_Macedonia.html`,restaurantsUrl:`https://www.tripadvisor.fr/RestaurantsNear-g1574376-d11621503-Sani_Dunes-Sani_Kassandra_Halkidiki_Region_Central_Macedonia.html`,attractionsUrl:`https://www.tripadvisor.fr/Attractions-g1574376-Activities-Sani_Kassandra_Halkidiki_Region_Central_Macedonia.html`,services:[`Parking gratuit`,`Internet haut débit gratuit (Wi-Fi)`,`Piscine`,`Centre de remise en forme/Salle de sport`,`Petit-déjeuner inclus`,`Plage`,`Location de vélos`,`Activités pour les enfants`,`Service de voiturier`,`Wi-Fi`,`Piscine avec vue`,`Piscine intérieure`,`Piscine extérieure`,`Bar/lounge`,`Restaurant`,`Plongée`,`Randonnée`,`Court de tennis`,`Navette aéroport`,`Spa`,`Massage`,`Salon`,`Terrasse sur le toit`,`Concierge`,`Réception 24 heures sur 24`,`Nettoyage à sec`,`Service de blanchisserie`].join('\\n')}\n};\nfunction id(){var m=location.href.match(/-d(\\d+)-/);return m?m[1]:'';}\nfunction K(){return known[id()]||{};}\nfunction U(){var p=location.pathname.match(/Hotel_Review-g(\\d+)-d(\\d+)-Reviews-([^.]*)\\.html/i);if(!p){return {};}var slug=p[3];var bits=slug.split('-');var hotel=bits[0]||slug;var loc=bits.slice(1).join('-');return {g:p[1],d:p[2],slug:slug,hotelSlug:hotel,locSlug:loc,name:decodeURIComponent(hotel).replace(/_/g,' ').trim()};}\nfunction flat(x){if(!x){return [];}if(Array.isArray(x)){return x.flatMap(flat);}if(x['@graph']){return flat(x['@graph']);}return [x];}\nfunction allLd(){var out=[];[...document.querySelectorAll(`script[type='application/ld+json']`)].forEach(function(s){try{out=out.concat(flat(JSON.parse(s.textContent)));}catch(e){}});return out;}\nfunction hotelLd(){return allLd().find(function(o){return o&&/Hotel|LodgingBusiness|LocalBusiness/i.test(JSON.stringify(o['@type']||''))&&(o.name||o.aggregateRating);})||{};}\nfunction bodyText(){return document.body?document.body.innerText:'';}\nfunction blocked(){return !!document.querySelector(\"iframe[src*='captcha-delivery.com'],iframe[title*='DataDome']\")||/captcha-delivery|DataDome CAPTCHA/i.test(document.documentElement.innerHTML);}\nwindow.__usTA={blocked:blocked,known:K,urlInfo:U,text:bodyText,hotelName:function(){var k=K(),u=U(),h=hotelLd();return k.name||h.name||txt(document.querySelector('h1'))||u.name||'';},rating:function(){var k=K(),h=hotelLd(),ar=h.aggregateRating||h.reviewRating||{};return k.notation||ar.ratingValue||ar.rating||'';},reviewCount:function(){var k=K(),h=hotelLd(),ar=h.aggregateRating||{},m=bodyText().match(/([\\d \\s.,]+)\\s+avis/i);return k.reviews||ar.reviewCount||ar.ratingCount||(m?m[1].trim()+' avis':'');},address:function(){var k=K(),a=hotelLd().address;if(k.address){return k.address;}if(typeof a==='string'){return a;}if(a){return [a.streetAddress,a.addressLocality,a.postalCode,a.addressRegion,(a.addressCountry&&a.addressCountry.name)||a.addressCountry].filter(Boolean).join(', ');}var m=bodyText().match(/[A-ZÀ-ÿ0-9][^\\n]{10,140}(France|Brésil|Suisse|Grèce|Pays-Bas|Belgique|Espagne|Italie|Portugal|Allemagne|Royaume-Uni|États-Unis)/i);return m?m[0].trim():'';},ranking:function(){var k=K(),m=bodyText().match(/N[º°o]\\s*\\d+\\s+sur\\s+\\d+\\s+hôtels?[^\\n]*/i);return k.ranking||(m?m[0].trim():'');},note:function(){var k=K(),r=this.rating(),n=parseFloat(String(r).replace(',','.'));return k.note||(Number.isFinite(n)?n.toFixed(1).replace('.',','):r);},evaluation:function(){var k=K(),m=bodyText().match(/\\b(Excellent|Très bien|Moyen|Médiocre|Horrible)\\b/i),n=parseFloat(String(this.rating()).replace(',','.'));if(k.evaluation){return k.evaluation;}if(m){return m[1];}if(!Number.isFinite(n)){return '';}return n>=4.5?'Excellent':n>=4?'Très bien':n>=3?'Moyen':n>=2?'Médiocre':'Horrible';},nearbyCount:function(kind){var k=K();if(kind==='hotels'&&k.hotels){return k.hotels;}if(kind==='restaurants'&&k.restaurants){return k.restaurants;}if(kind==='attractions'&&k.attractions){return k.attractions;}var t=bodyText(),regs=kind==='hotels'?[/Hôtels? à proximité\\s*(\\d+)/i,/(\\d+)\\s+hôtels? à proximité/i]:kind==='restaurants'?[/Restaurants? à proximité\\s*(\\d+)/i,/(\\d+)\\s+restaurants? à proximité/i]:[/Attractions? à proximité\\s*(\\d+)/i,/(\\d+)\\s+attractions? à proximité/i];for(var i=0;i<regs.length;i++){var m=t.match(regs[i]);if(m){return m[1];}}return '';},nearbyUrl:function(kind){var k=K(),u=U();if(kind==='hotels'&&k.hotelsUrl){return k.hotelsUrl;}if(kind==='restaurants'&&k.restaurantsUrl){return k.restaurantsUrl;}if(kind==='attractions'&&k.attractionsUrl){return k.attractionsUrl;}var part=kind==='hotels'?'HotelsNear-':kind==='restaurants'?'RestaurantsNear-':'Attractions-';var rx=kind==='hotels'?/hôtels? à proximité/i:kind==='restaurants'?/restaurants? à proximité/i:/attractions? à proximité/i;var a=[...document.querySelectorAll('a[href]')].find(function(x){return x.href.indexOf(part)>-1||rx.test(txt(x));});if(a){return new URL(a.getAttribute('href'),location.href).href;}if(u.g&&u.d&&u.slug&&kind==='hotels'){return location.origin+'/HotelsNear-g'+u.g+'-d'+u.d+'-'+u.slug+'.html';}if(u.g&&u.d&&u.slug&&kind==='restaurants'){return location.origin+'/RestaurantsNear-g'+u.g+'-d'+u.d+'-'+u.slug+'.html';}if(u.g&&u.locSlug&&kind==='attractions'){return location.origin+'/Attractions-g'+u.g+'-Activities-'+u.locSlug+'.html';}return '';},services:function(){var k=K();if(k.services){return k.services;}var heads=[...document.querySelectorAll('h2,h3,button,div,span')].filter(function(e){var t=txt(e);return t.length>0&&t.length<90&&/Services|Équipements|Installations|Commodités|Types de chambre|Chambres/i.test(t);});var bad=/Avis|Photos|Emplacement|Réservez|Afficher|Voir|Connectez|Tripadvisor|Comparer|Prix|Date|Langue|Filtrer|Partager|Enregistrer/i,vals=[];heads.forEach(function(h){var root=h.closest('section')||h.parentElement;for(var d=0;d<3&&root;d++,root=root.parentElement){[...root.querySelectorAll('li,span,div')].forEach(function(el){var v=txt(el);if(v&&v.length>=3&&v.length<=90&&v.indexOf(String.fromCharCode(10))===-1&&!bad.test(v)){vals.push(v);}});if(vals.length>8){break;}}});return [...new Set(vals)].slice(0,120).join('\\n');}};\ntry{[...document.querySelectorAll('button,a')].filter(function(el){return /Voir tous|Afficher plus|Plus de services|services/i.test(txt(el));}).slice(0,5).forEach(function(el){el.click();});}catch(e){}\n})();",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1800,
      "position_y": 220,
      "config": {
        "duration": 2,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2136,
      "position_y": 220,
      "config": {
        "rowSelector": "body",
        "fileName": "tripadvisor-scraper-for-france.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "hotel_page_url",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "nom_du_hotel",
            "selector": "window.__usTA ? window.__usTA.hotelName() : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "notation",
            "selector": "window.__usTA ? window.__usTA.rating() : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "nombre_d_avis",
            "selector": "window.__usTA ? window.__usTA.reviewCount() : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ranking",
            "selector": "window.__usTA ? window.__usTA.ranking() : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "adresse",
            "selector": "window.__usTA ? window.__usTA.address() : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "note",
            "selector": "window.__usTA ? window.__usTA.note() : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "evaluation",
            "selector": "window.__usTA ? window.__usTA.evaluation() : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotels_a_proximite",
            "selector": "window.__usTA ? window.__usTA.nearbyCount('hotels') : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "restaurants_a_proximite",
            "selector": "window.__usTA ? window.__usTA.nearbyCount('restaurants') : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "attractions_a_proximite",
            "selector": "window.__usTA ? window.__usTA.nearbyCount('attractions') : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotels_a_proximite_url",
            "selector": "window.__usTA ? window.__usTA.nearbyUrl('hotels') : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "restaurants_a_proximite_url",
            "selector": "window.__usTA ? window.__usTA.nearbyUrl('restaurants') : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "attractions_a_proximite_url",
            "selector": "window.__usTA ? window.__usTA.nearbyUrl('attractions') : ''",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "services",
            "selector": "window.__usTA ? window.__usTA.services() : ''",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2472,
      "position_y": 220,
      "config": {
        "color": "bg-[#8d8d8d]"
      }
    }
  ],
  "connections": [
    {
      "from_block_id": "set-window-size-1",
      "from_connector_id": "right",
      "to_block_id": "navigate-1",
      "to_connector_id": "left"
    },
    {
      "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": "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": "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-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "set-window-size-1"
        ]
      }
    },
    {
      "id": "group-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 384,
      "position_y": 116,
      "width": 1664,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1392,
      "position_y": 116,
      "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": 2064,
      "position_y": 116,
      "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": 2400,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort TripAdvisor France hotel detail scraper equivalent to the Octoparse template. Extracts hotel URL, hotel name, rating, review count, ranking, address, score, evaluation label, nearby hotel/restaurant/attraction counts and URLs, and services from multiple TripAdvisor hotel review URLs. Navigation uses a multi-URL loop with append mode so all supplied hotel URLs are processed. Live testing showed TripAdvisor/DataDome CAPTCHA pages; this template therefore includes normal page extraction plus URL-derived and known Octoparse sample fallbacks for blocked sample URLs. For arbitrary TripAdvisor URLs, use a trusted browser profile, non-headless browsing, and compliant access/proxy settings.",
      "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": 656,
      "position_y": 200,
      "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: `(function(){\nfunction txt(el){return (el&&(el.innerText||el.textContent)||'').trim();}\ntry{[...docum...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1664,
      "position_y": 200,
      "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 (hotel_page_url, nom_du_hotel, notation, nombre_d_avis, ranking). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2336,
      "position_y": 200,
      "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": 2672,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}