{
  "version": "1.0.0",
  "exported_at": "2026-06-01T00:00:00.000Z",
  "project": {
    "name": "Booking HÃtel Info Scraper",
    "description": "Equivalent UScraper template for the Octoparse Booking hotel info scraper. Scrapes Booking.com hotel detail pages supplied as input URLs and exports hotel name, address/location, description, room, bed, availability, review label, review count, main Booking review score, price/night, price, tax text, star/quality rating, tag/promotion, and detail URL. Navigation strategy: multi-URL input via navigate.urls[] plus loop-continue, so every supplied Booking hotel detail URL is processed into one appended CSV. Booking.com may vary by locale, selected dates, currency, cookies, or bot/CAPTCHA checks; price and availability fields are best-effort and usually require date-bearing Booking URLs.",
    "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": 260,
      "config": {
        "width": 1920,
        "height": 1080,
        "color": "bg-[#4589ff]"
      }
    },
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 480,
      "position_y": 260,
      "config": {
        "urls": [
          "https://www.booking.com/hotel/fr/lelavoisierparis.fr.html",
          "https://www.booking.com/hotel/fr/mercure-paris-gare-de-lyon.fr.html",
          "https://www.booking.com/hotel/fr/elegance-amp-confort-a-deux-pas-de-la-madeleine.fr.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": 840,
      "position_y": 260,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "selector": "h2",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 260,
      "config": {
        "rowSelector": "body",
        "fileName": "booking-hotel-info-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "nom",
            "selector": "(() => { const h2 = document.querySelector('h2'); const fn = document.querySelector('.fn'); const og = document.querySelector('meta[property=\"og:title\"]')?.content || ''; return (h2?.innerText || fn?.innerText || og.replace(/,\\s*Paris.*$/i, '') || '').trim(); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "adresse",
            "selector": "(() => { const direct = document.querySelector('[data-testid=\"address\"], .hp_address_subtitle, #showMap2 span'); if (direct?.innerText?.trim()) return direct.innerText.trim().replace(/\\s+/g, ' '); const title = (document.querySelector('h2')?.innerText || document.querySelector('.fn')?.innerText || '').trim(); const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const idx = lines.findIndex(l => l === title); const hit = lines.slice(Math.max(0, idx), idx + 12).find(l => /France/i.test(l) && /\\d/.test(l) && !/note|commentaire|photo|carte/i.test(l)); return hit || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "description",
            "selector": "(() => { const meta = document.querySelector('meta[name=\"description\"], meta[property=\"og:description\"]'); if (meta?.content) return meta.content.trim().replace(/\\s+/g, ' '); const p = document.querySelector('#property_description_content, [data-testid=\"property-description\"], .hp_desc_main_content'); return (p?.innerText || '').trim().replace(/\\s+/g, ' '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "chambre",
            "selector": "(() => { const room = document.querySelector('a[href*=\"#RD\"], .hprt-roomtype-link, [data-testid=\"room-name\"]'); if (room?.innerText?.trim()) return room.innerText.trim().replace(/\\s+/g, ' '); const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const hit = lines.find(l => /^(Chambre|Suite|Appartement|Studio)\\b/i.test(l) && l.length < 120); return hit || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "lit",
            "selector": "(() => { const bed = document.querySelector('[data-testid=\"bed-type\"], .rt-bed-type, .hprt-roomtype-bed'); if (bed?.innerText?.trim()) return bed.innerText.trim().replace(/\\s+/g, ' '); const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const hit = lines.find(l => /\\b(\\d+\\s+(?:lit|lits)|canapé-lit|grand lit|lit double|lits simples)\\b/i.test(l) && l.length < 120 && !/Chambre Privilège|Chambre Double|Appartement 2 Chambres/i.test(l)); return hit || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "disponibilite",
            "selector": "(() => { const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const hit = lines.find(l => /Plus que\\s+\\d+\\s+disponible/i.test(l)) || lines.find(l => /Veuillez sélectionner des dates pour voir les disponibilités|saisir les dates de votre séjour|Voir les tarifs/i.test(l) && l.length < 180); return hit || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "appreciation",
            "selector": "(() => { const direct = document.querySelector('.review_score_word, [data-testid=\"review-score-word\"], .bui-review-score__title'); if (direct?.innerText?.trim()) return direct.innerText.trim(); const t = document.body.innerText.replace(/\\u00a0/g, ' '); const chunks = Array.from(t.matchAll(/Avec une note de\\s*[0-9]+[.,][0-9](?!\\s*\\/10)[\\s\\S]{0,180}?expériences vécues/gi)).map(m => m[0]); const section = chunks.find(s => /Exceptionnel|Fabuleux|Superbe|Très bien|Tres bien|Bien|Agréable/i.test(s)) || ''; const m = section.match(/\\b(Exceptionnel|Fabuleux|Superbe|Très bien|Tres bien|Bien|Agréable)\\b/i); return m ? m[1].toLowerCase() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "experience",
            "selector": "(() => { const t = document.body.innerText.replace(/\\u00a0/g, ' '); const nav = Array.from(document.querySelectorAll('a[href*=\"blockdisplay\"], a[href*=\"reviews\"]')).map(a => a.innerText).find(x => /Commentaires clients/i.test(x)); const m1 = nav && nav.match(/\\(([\\d\\s.,]+)\\)/); if (m1) return m1[1].trim(); const scoreText = t.match(/([\\d\\s.,]+)\\s+expériences vécues/i); return scoreText ? scoreText[1].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "note",
            "selector": "(() => { const t = document.body.innerText.replace(/\\u00a0/g, ' '); const chunks = Array.from(t.matchAll(/Avec une note de\\s*([0-9]+)[.,]([0-9])(?!\\s*\\/10)[\\s\\S]{0,180}?expériences vécues/gi)); const m = chunks.find(x => /Exceptionnel|Fabuleux|Superbe|Très bien|Tres bien|Bien|Agréable/i.test(x[0])) || chunks[0]; return m ? `${m[1]}.${m[2]}` : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "prix_nuit",
            "selector": "(() => { const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const hit = lines.find(l => /\\d+\\s+nuit/i.test(l) && /adulte|adultes|personne|personnes/i.test(l)); return hit || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "prix",
            "selector": "(() => { const priceEl = document.querySelector('[data-testid=\"price-and-discounted-price\"], .prco-valign-middle-helper, .bui-price-display__value'); if (priceEl?.innerText?.match(/\\d/)) return priceEl.innerText.trim().replace(/\\s+/g, ' '); const t = document.body.innerText.replace(/\\u00a0/g, ' '); const matches = Array.from(t.matchAll(/(?:€|EUR|US\\$|\\$)\\s*[0-9][\\d\\s.,]*/g)).map(m => m[0].trim()).filter(v => /\\d/.test(v)); return matches.find(v => !/^EUR$/i.test(v) && !/^USD$/i.test(v)) || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "taxe",
            "selector": "(() => { const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const hit = lines.find(l => /Taxes? et frais compris|taxes? comprises?|frais compris|non compris/i.test(l) && l.length < 120); return hit || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(() => { const labels = Array.from(document.querySelectorAll('[aria-label]')).map(e => e.getAttribute('aria-label') || ''); const star = labels.find(v => /[1-5](?:[.,]0)?\\s*étoile/i.test(v)); if (star) { const m = star.match(/([1-5](?:[.,]0)?)/); if (m) return m[1].replace(',', '.'); } const starBox = document.querySelector('[data-testid=\"rating-stars\"], .bui-rating, .hp__hotel_ratings'); if (starBox) { const count = starBox.querySelectorAll('svg').length || starBox.querySelectorAll('[aria-hidden=\"true\"]').length; if (count > 0 && count <= 5) return String(count); } const body = document.body.innerText; const qIdx = body.search(/Évaluation de la qualité/i); const qSec = qIdx >= 0 ? body.slice(qIdx, qIdx + 300) : ''; const nums = qSec.match(/\\b([1-5])\\b/g); return nums && nums.length ? nums[nums.length - 1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "tag",
            "selector": "(() => { const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const tags = lines.filter(l => /Offre à Durée Limitée|Offre Début|Travel Proud|Certificat de durabilité|Genius/i.test(l) && l.length < 80); return Array.from(new Set(tags)).join(' | '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "url_detail",
            "selector": "(() => location.href.split('#')[0])()",
            "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": 260,
      "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": "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": 156,
      "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": 408,
      "position_y": 156,
      "width": 1400,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "wait-for-element-1",
          "sleep-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 156,
      "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": 156,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Equivalent UScraper template for the Octoparse Booking hotel info scraper. Scrapes Booking.com hotel detail pages supplied as input URLs and exports hotel name, address/location, description, room, bed, availability, review label, review count, main Booking review score, price/night, price, tax text, star/quality rating, tag/promotion, and detail URL. Navigation strategy: multi-URL input via navigate.urls[] plus loop-continue, so every supplied Booking hotel detail URL is processed into one appended CSV. Booking.com may vary by locale, selected dates, currency, cookies, or bot/CAPTCHA checks; price and availability fields are best-effort and usually require date-bearing Booking URLs.",
      "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": 680,
      "position_y": 240,
      "width": 328,
      "height": 107,
      "z_index": 22,
      "data": {
        "block_id": "navigate-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (nom, adresse, description, chambre, lit). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 240,
      "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": 2480,
      "position_y": 240,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}