{
  "version": "1.0.0",
  "exported_at": "2026-06-02T02:00:00.000Z",
  "project": {
    "name": "Tripcom Scraper",
    "description": "Best-effort Trip.com hotel detail scraper equivalent to the Octoparse Trip.com Scraper. Extracts one row per hotel detail URL: page URL, hotel name, address, star/rating values, up to 7 image URLs, price, description, opened time, amenities, review count, rating breakdowns, and current timestamp. Navigation strategy: multi-URL input using navigate.urls[] plus loop-continue, so all supplied hotel detail URLs are processed. Note: attached analysis showed Trip.com redirected the sample hotel URL to sign-in, so results depend on access/session availability in the UScraper browser profile.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "set-window-size-1",
      "block_type": "process",
      "title": "Set Window Size",
      "description": "Set browser viewport size",
      "position_x": 120,
      "position_y": 240,
      "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": 240,
      "config": {
        "urls": [
          "https://www.trip.com/hotels/detail/?cityId=633&hotelId=66665501&checkIn=2024-04-13&checkOut=2024-04-14&adult=2&children=0&subStamp=1558&crn=1&ages=&travelpurpose=0&curr=HKD&link=title&hoteluniquekey=H4sIAAAAAAAAAON6yMjFJMEkxMTBKHWNkePq7P29rEKMRgasFp8FHfsPfdWIMZ7t4Nn6OnCH3Jz5DgE8hQwg0JDjMInRllNknfvDqoJiB0EQLaJU6KCkqMCiCVNhCGNYPOMMYuNYfYBRgiWKwYmNY-IHPgmWGYxzfzyR38h4fXGBLdfiQocdjEwnGO_xLWB6f2Gj0S4mNo6d-xglmA4BGfffATWeYmK4xMRwi4nhERPUqFdMDJ-YGH7BVDYxM3QxM0xihqqfxQxVtoiZQYrXzMgsKc3cIjUlNdUgWUFI48yhNxvYjJQmMTJFRJxilDI0NzQyMTM3NDAxNTHSs0xNSUn0KM4IiijNt2KWYnTzYAxiMzZzNXZxitLiYg4NdhEE-4zhg70Us4e3i-KsmUAQKe-gBZIz7Lx07wH3ZxmHJNbUPN2IiIxO_gLGLkYOAUYPxgjGCsZXjCA9P8C-BwAKW7RPfQEAAA&subChannel=&masterhotelid_tracelogid=626bf78edee0c&NewTaxDescForAmountshowtype0=T&detailFilters=17%7C1~17~1*80%7C0%7C1~80~0&hotelType=normal&barcurr=HKD&locale=en-XX&isRightClick=T",
          "https://www.trip.com/hotels/detail/?cityId=633&hotelId=106493002&checkIn=2024-04-13&checkOut=2024-04-14&adult=2&children=0&subStamp=1558&crn=1&ages=&travelpurpose=0&curr=HKD&link=title&hoteluniquekey=H4sIAAAAAAAAAONaycjFJMEkxMTBKDWPkePYlGOTWIUYjQw4LT4JOra-Dtwhxz7bwZMBBDLnOwTwTGKU4ozpP_RVI6bQQfANULp1d76DExvHriW8EiwzGE-9eGy0kREs3l7osIOR6QTjRb4FTGt37jHaxcTGcQ-k6hCQsfQtowTLKSaGS0wMt5gYHjExvGJi-MTE8AumpomZoYuZYRIzVOUsZoZFzAxSvGZGZklp5hapKampBskKQhpnDr3ZwGakNImRKSLiFKOUobmhkYmZuaGBiamJkZ5lakpKokdxRlBEab4VsxSjmwdjEJuFpYGRo1GUFhdzaLCLINhfDB_spZg9vF0UZ80Egkh5By2QnGHnpXsPuD_LOCSxpubpRkRkdPIXMHYxcggwejBGMFYwvmIE6fkB9jEAAKVR8UUBAAA&subChannel=&masterhotelid_tracelogid=626bf78edee0c&NewTaxDescForAmountshowtype0=T&detailFilters=17%7C1~17~1*80%7C0%7C1~80~0&hotelType=normal&barcurr=HKD&locale=en-XX&isRightClick=T"
        ],
        "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": 840,
      "position_y": 240,
      "config": {
        "timeout": 45,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 240,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "inject-javascript-1",
      "block_type": "process",
      "title": "Inject JavaScript",
      "description": "Run custom JavaScript",
      "position_x": 1560,
      "position_y": 240,
      "config": {
        "jsCode": "window.scrollTo(0, Math.min(document.body.scrollHeight, 2400)); setTimeout(() => window.scrollTo(0, 0), 800);",
        "waitForCompletion": true,
        "timeout": 10,
        "color": "bg-[#a56eff]"
      }
    },
    {
      "block_id": "sleep-2",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1920,
      "position_y": 240,
      "config": {
        "duration": 2,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 2280,
      "position_y": 240,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 2640,
      "position_y": 240,
      "config": {
        "rowSelector": "body",
        "fileName": "trip-com-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "web_page_url",
            "selector": "(()=>{try{const u=new URL(location.href);return u.searchParams.get('backurl')||location.href;}catch(e){return location.href;}})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_name",
            "selector": "(()=>{const pick=s=>document.querySelector(s)?.textContent?.trim();const meta=document.querySelector('meta[property=\"og:title\"],meta[name=\"twitter:title\"]')?.content?.trim();const candidates=['h1','[data-testid*=\"hotel\" i][data-testid*=\"name\" i]','[class*=\"hotel\" i][class*=\"name\" i]','[class*=\"detail\" i][class*=\"name\" i]'];for(const s of candidates){const v=pick(s);if(v&&v.length>2&&v.length<160&&!/sign in|register/i.test(v))return v;}return (meta||document.title||'').replace(/\\s*[|\\-]\\s*Trip\\.com.*$/i,'').trim();})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_address",
            "selector": "(()=>{const sels=['[data-testid*=\"address\" i]','[class*=\"address\" i]','[class*=\"position\" i]','[class*=\"location\" i]'];for(const s of sels){const el=[...document.querySelectorAll(s)].find(e=>{const t=(e.innerText||e.textContent||'').trim();return t.length>8&&t.length<300&&!/rating|reviews|nearby|popular/i.test(t);});if(el)return (el.innerText||el.textContent||'').replace(/\\s+/g,' ').trim();}const t=document.body.innerText;const m=t.match(/\\d+[^\\n]{5,160}(Street|St\\b|Avenue|Ave\\b|Road|Rd\\b|Boulevard|Blvd\\b|Drive|Dr\\b|Lane|Ln\\b|United States|United Kingdom|China|Japan|Singapore|Thailand)[^\\n]{0,120}/i);return m?m[0].replace(/\\s+/g,' ').trim():'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_star_rating",
            "selector": "(()=>{const t=document.body.innerText;let m=t.match(/(?:Star Rating|Hotel Star Rating|Stars?)\\s*[:：]?\\s*([0-5](?:\\.\\d)?)/i);if(m)return m[1];m=t.match(/([0-5](?:\\.\\d)?)\\s*(?:\\/\\s*5)?\\s*(?:Excellent|Very Good|Good|Reviews|review score)/i);return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_1",
            "selector": "(()=>{const imgs=Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/tripcdn\\.com\\/images\\//i.test(src)&&!/logo|icon|flag|payment|svg/i.test(src));return [...new Set(imgs)][0]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_2",
            "selector": "(()=>{const imgs=Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/tripcdn\\.com\\/images\\//i.test(src)&&!/logo|icon|flag|payment|svg/i.test(src));return [...new Set(imgs)][1]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_3",
            "selector": "(()=>{const imgs=Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/tripcdn\\.com\\/images\\//i.test(src)&&!/logo|icon|flag|payment|svg/i.test(src));return [...new Set(imgs)][2]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_4",
            "selector": "(()=>{const imgs=Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/tripcdn\\.com\\/images\\//i.test(src)&&!/logo|icon|flag|payment|svg/i.test(src));return [...new Set(imgs)][3]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_5",
            "selector": "(()=>{const imgs=Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/tripcdn\\.com\\/images\\//i.test(src)&&!/logo|icon|flag|payment|svg/i.test(src));return [...new Set(imgs)][4]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_6",
            "selector": "(()=>{const imgs=Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/tripcdn\\.com\\/images\\//i.test(src)&&!/logo|icon|flag|payment|svg/i.test(src));return [...new Set(imgs)][5]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_7",
            "selector": "(()=>{const imgs=Array.from(document.images).map(i=>i.currentSrc||i.src).filter(src=>/tripcdn\\.com\\/images\\//i.test(src)&&!/logo|icon|flag|payment|svg/i.test(src));return [...new Set(imgs)][6]||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_price",
            "selector": "(()=>{const sels=['[data-testid*=\"price\" i]','[class*=\"price\" i]','[class*=\"amount\" i]'];for(const s of sels){const el=[...document.querySelectorAll(s)].find(e=>/([A-Z]{3}|HK\\$|US\\$|\\$|€|£|¥)\\s*[\\d,.]+|[\\d,.]+\\s*(k|K|HKD|USD|EUR|GBP|JPY|CNY)/.test(e.innerText||e.textContent||''));if(el)return (el.innerText||el.textContent||'').replace(/\\s+/g,' ').trim();}const t=document.body.innerText;const m=t.match(/(?:HK\\$|US\\$|\\$|€|£|¥|HKD|USD|EUR|GBP|JPY|CNY)\\s*[\\d,.]+[kK]?|[\\d,.]+[kK]?\\s*(?:HKD|USD|EUR|GBP|JPY|CNY)/);return m?m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_description",
            "selector": "(()=>{const meta=document.querySelector('meta[name=\"description\"],meta[property=\"og:description\"]')?.content?.trim();const sels=['[data-testid*=\"description\" i]','[class*=\"description\" i]','[class*=\"overview\" i]'];for(const s of sels){const el=[...document.querySelectorAll(s)].find(e=>{const t=(e.innerText||e.textContent||'').trim();return t.length>120;});if(el)return (el.innerText||el.textContent||'').replace(/\\s+/g,' ').trim();}const ps=[...document.querySelectorAll('p,section,div')].map(e=>(e.innerText||e.textContent||'').trim()).filter(t=>t.length>180&&t.length<3000&&!/sign in|continue with email/i.test(t));return (ps[0]||meta||'').replace(/\\s+/g,' ').trim();})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "opened_time",
            "selector": "(()=>{const t=document.body.innerText;const m=t.match(/(?:Opened|Open(?:ed)? in|Renovated)\\s*[:：]?\\s*(?:in\\s*)?\\d{4}/i);return m?m[0].replace(/\\s+/g,' ').trim():'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "most_popular_amenities",
            "selector": "(()=>{const amenityEls=[...document.querySelectorAll('[data-testid*=\"amenit\" i],[class*=\"amenit\" i],[class*=\"facility\" i],[class*=\"Facilities\" i]')].map(e=>(e.innerText||e.textContent||'').trim()).filter(t=>t&&t.length<80&&!/popular amenities|show all/i.test(t));let vals=[...new Set(amenityEls)].slice(0,20);if(vals.length)return vals.join(';');const text=document.body.innerText;const m=text.match(/(?:Most Popular Amenities|Popular Amenities|Amenities)\\s*([\\s\\S]{0,500})/i);return m?m[1].split('\\n').map(x=>x.trim()).filter(Boolean).slice(0,20).join(';'):'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "number_of_reviews",
            "selector": "(()=>{const t=document.body.innerText;const m=t.match(/([\\d,.]+[kK]?)\\s*(?:verified\\s*)?(?:reviews|review)/i);return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "overall_rating",
            "selector": "(()=>{const t=document.body.innerText;let m=t.match(/(?:Overall|Rating|Review score)\\s*[:：]?\\s*([0-5](?:\\.\\d)?)/i);if(m)return m[1];m=t.match(/([0-5](?:\\.\\d)?)\\s*(?:\\/\\s*5)?\\s*(?:Excellent|Very Good|Good|reviews|review score)/i);return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "location_rating",
            "selector": "(()=>{const t=document.body.innerText;const m=t.match(/Location\\s*[:：]?\\s*([0-5](?:\\.\\d)?)/i);return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "cleanliness_rating",
            "selector": "(()=>{const t=document.body.innerText;const m=t.match(/Cleanliness\\s*[:：]?\\s*([0-5](?:\\.\\d)?)/i);return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "service_rating",
            "selector": "(()=>{const t=document.body.innerText;const m=t.match(/Service\\s*[:：]?\\s*([0-5](?:\\.\\d)?)/i);return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "amenities_rating",
            "selector": "(()=>{const t=document.body.innerText;const m=t.match(/Amenities\\s*[:：]?\\s*([0-5](?:\\.\\d)?)/i);return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_time",
            "selector": "(()=>{const d=new Date();const pad=n=>String(n).padStart(2,'0');return d.getFullYear()+'-'+pad(d.getMonth()+1)+'-'+pad(d.getDate())+' '+pad(d.getHours())+':'+pad(d.getMinutes())+':'+pad(d.getSeconds());})()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 3000,
      "position_y": 240,
      "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": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-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-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-2",
      "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-entry",
      "element_type": "group",
      "title": "Entry & Setup",
      "color": "#4589ff",
      "position_x": 48,
      "position_y": 136,
      "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": 136,
      "width": 2120,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "sleep-2",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-interaction",
      "element_type": "group",
      "title": "Interaction",
      "color": "#a56eff",
      "position_x": 1488,
      "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": 2568,
      "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": 2928,
      "position_y": 136,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort Trip.com hotel detail scraper equivalent to the Octoparse Trip.com Scraper. Extracts one row per hotel detail URL: page URL, hotel name, address, star/rating values, up to 7 image URLs, price, description, opened time, amenities, review count, rating breakdowns, and current timestamp. Navigation strategy: multi-URL input using navigate.urls[] plus loop-continue, so all supplied hotel detail URLs are processed. Note: attached analysis showed Trip.com redirected the sample hotel URL to sign-in, so results depend on access/session availability in the UScraper browser profile.",
      "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 2 pages. Pair with loop-continue at the end of each iteration.",
      "color": "#ee5396",
      "position_x": 680,
      "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: `window.scrollTo(0, Math.min(document.body.scrollHeight, 2400)); setTimeout(() => window.scrollTo(0, ...` Verify in browser if results are empty.",
      "color": "#ee5396",
      "position_x": 1760,
      "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 (web_page_url, hotel_name, hotel_address, hotel_star_rating, image_1). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2840,
      "position_y": 220,
      "width": 340,
      "height": 136,
      "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": 220,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}