{
  "version": "1.0.0",
  "exported_at": "2026-06-01T12:00:00.000Z",
  "project": {
    "name": "Agoda Hotel Scraper",
    "description": "Scrapes Agoda hotel booking information from provided Agoda hotel detail URLs, including destination, availability/search context, dates, guests, hotel name, URL, address/location, rating text, review score, review count, amenities, highlights, recent booking text, price or sold-out status, and cancellation text. Navigation strategy: known URL list with loop-continue; add more Agoda hotel detail URLs to navigate.urls to scrape additional hotels. Agoda may show cookie/CAPTCHA challenges that require manual handling in the browser.",
    "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": 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.agoda.com/ko-kr/shilla-stay-jeju/hotel/jeju-island-kr.html?finalPriceView=1&isShowMobileAppPrice=false&cid=1755781&numberOfBedrooms=&familyMode=false&adults=2&children=1&rooms=1&maxRooms=0&checkIn=2023-12-5&isCalendarCallout=false&childAges=9&numberOfGuest=0&missingChildAges=false&travellerType=2&showReviewSubmissionEntry=false&currencyCode=KRW&isFreeOccSearch=false&tag=b6b2d42c-aa03-4b92-97ab-c4f8dc7d016e&isCityHaveAsq=false&los=2&searchrequestid=8ce3f39e-6713-4ad7-8ac1-02131b15dfe3&utm_medium=cpc&utm_source=naver&utm_campaign=m.competitive&utm_content=c_gnric&utm_term=%EC%88%99%EB%B0%95%EC%98%88%EC%95%BD",
          "https://www.agoda.com/ko-kr/jeju-hotel-the-m/hotel/jeju-island-kr.html?finalPriceView=1&isShowMobileAppPrice=false&cid=1755781&numberOfBedrooms=&familyMode=false&adults=2&children=1&rooms=1&maxRooms=0&checkIn=2023-12-5&isCalendarCallout=false&childAges=9&numberOfGuest=0&missingChildAges=false&travellerType=2&showReviewSubmissionEntry=false&currencyCode=KRW&isFreeOccSearch=false&tag=b6b2d42c-aa03-4b92-97ab-c4f8dc7d016e&isCityHaveAsq=false&tspTypes=6&los=2&searchrequestid=8ce3f39e-6713-4ad7-8ac1-02131b15dfe3&utm_medium=cpc&utm_source=naver&utm_campaign=m.competitive&utm_content=c_gnric&utm_term=%EC%88%99%EB%B0%95%EC%98%88%EC%95%BD",
          "https://www.agoda.com/ko-kr/ebenezer-hotel/hotel/jeju-island-kr.html?finalPriceView=1&isShowMobileAppPrice=false&cid=1755781&numberOfBedrooms=&familyMode=false&adults=2&children=1&rooms=1&maxRooms=0&checkIn=2023-12-5&isCalendarCallout=false&childAges=9&numberOfGuest=0&missingChildAges=false&travellerType=2&showReviewSubmissionEntry=false&currencyCode=KRW&isFreeOccSearch=false&tag=b6b2d42c-aa03-4b92-97ab-c4f8dc7d016e&isCityHaveAsq=false&tspTypes=2,8&los=2&searchrequestid=8ce3f39e-6713-4ad7-8ac1-02131b15dfe3&utm_medium=cpc&utm_source=naver&utm_campaign=m.competitive&utm_content=c_gnric&utm_term=%EC%88%99%EB%B0%95%EC%98%88%EC%95%BD"
        ],
        "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": 45,
        "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": "h1",
        "timeout": 45,
        "visible": true,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1464,
      "position_y": 220,
      "config": {
        "duration": 3,
        "color": "bg-[#08bdba]"
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1800,
      "position_y": 220,
      "config": {
        "rowSelector": "body",
        "fileName": "agoda-hotel-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "destination",
            "selector": "(() => { const crumbs = Array.from(document.querySelectorAll('a.breadcrumb-link')).map(a => a.textContent.trim()).filter(Boolean); const city = crumbs.find(t => /제주\\s*숙소/.test(t)) || crumbs[crumbs.length - 1] || ''; return city.replace(/\\s*숙소.*$/, '').trim() || '제주'; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "available_hotels",
            "selector": "(() => { const linkText = Array.from(document.querySelectorAll('a')).map(a => a.textContent.trim()).find(t => /숙소 모두 보기/.test(t)); return linkText || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "start_date",
            "selector": "(() => { const txt = document.body.innerText; const dates = txt.match(/\\d{4}년\\s*\\d{1,2}월\\s*\\d{1,2}일\\s*[월화수목금토일]요일/g) || []; return dates[0] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "end_date",
            "selector": "(() => { const txt = document.body.innerText; const dates = txt.match(/\\d{4}년\\s*\\d{1,2}월\\s*\\d{1,2}일\\s*[월화수목금토일]요일/g) || []; return dates[1] || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "guests_and_rooms",
            "selector": "(() => { const txt = document.body.innerText.replace(/\\s+/g, ' '); const m = txt.match(/성인\\s*\\d+명\\s*,?\\s*아동\\s*\\d+명\\s*객실\\s*\\d+개/); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_name",
            "selector": "(() => { return document.querySelector('h1')?.innerText.trim() || document.querySelector('meta[property=\"og:image:alt\"]')?.content || document.querySelector('meta[property=\"og:title\"]')?.content || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_link",
            "selector": "(() => { return document.querySelector('meta[property=\"og:url\"]')?.content || location.href; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "location_and_distance",
            "selector": "(() => { const meta = n => document.querySelector(`meta[property=\"${n}\"]`)?.content || ''; const parts = [meta('og:street_address'), meta('og:region'), '제주', meta('og:country-name')].filter(Boolean); const base = Array.from(new Set(parts)).join(', '); const txt = document.body.innerText; const distance = (txt.match(/도심까지\\s*[\\d.]+km/) || txt.match(/해변까지\\s*[\\d.]+m/) || txt.match(/도심에 위치/))?.[0] || ''; return [base, distance].filter(Boolean).join(' - '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_rating",
            "selector": "(() => { const h2 = Array.from(document.querySelectorAll('h2')).map(h => h.innerText.trim()).find(t => /^\\d+(?:\\.\\d+)?\\s*\\S+/.test(t)); return h2 ? h2.replace(/^\\d+(?:\\.\\d+)?\\s*/, '').trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_score",
            "selector": "(() => { const txt = document.body.innerText; const fromText = txt.match(/숙소 평점\\s*10\\s*만점에\\s*([\\d.]+)점/); if (fromText) return fromText[1]; const h2 = Array.from(document.querySelectorAll('h2')).map(h => h.innerText.trim()).find(t => /^\\d+(?:\\.\\d+)?/.test(t)); return h2 ? (h2.match(/^\\d+(?:\\.\\d+)?/) || [''])[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_count",
            "selector": "(() => { const txt = document.body.innerText; const m = txt.match(/([\\d,]+)\\s*건의 이용후기/); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_star_rating",
            "selector": "(() => { const txt = document.body.innerText.replace(/\\s+/g, ' '); const m = txt.match(/(\\d+(?:\\.\\d+)?)성급/); return m ? m[1] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "amenities",
            "selector": "(() => { const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const start = lines.findIndex(l => l === '편의 시설/서비스'); const end = lines.findIndex((l, i) => i > start && l === '숙소 소개'); if (start >= 0 && end > start) return lines.slice(start + 1, end).filter(l => !/^더 보기$/.test(l)).join(' | '); return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "highlights",
            "selector": "(() => { const lines = document.body.innerText.split('\\n').map(s => s.trim()).filter(Boolean); const start = lines.findIndex(l => l === '주요 특징'); const end = lines.findIndex((l, i) => i > start && l === '편의 시설/서비스'); if (start >= 0 && end > start) return lines.slice(start + 1, end).slice(0, 20).join(' | '); return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "recent_booking",
            "selector": "(() => { const txt = document.body.innerText; const m = txt.match(/오늘\\s*\\d+명의 여행객이 이 숙소 예약함/) || txt.match(/현재 인기[^\\n]{0,40}예약됨/); return m ? m[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price_start",
            "selector": "(() => { const txt = document.body.innerText; if (/판매 완료/.test(txt)) return '판매 완료'; const krw = txt.match(/(?:₩|KRW|원)\\s*[\\d,]+/) || txt.match(/[\\d,]+\\s*원/); return krw ? krw[0].trim() : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "free_cancellation",
            "selector": "(() => { const txt = document.body.innerText; const m = txt.match(/예약 무료 취소|무료 취소 가능|무료 취소/); return m ? m[0] : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "image_url",
            "selector": "(() => { return document.querySelector('meta[property=\"og:image\"]')?.content || document.querySelector('.AboutHotelMosaic img')?.src || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "latitude",
            "selector": "(() => { return document.querySelector('meta[property=\"place:location:latitude\"]')?.content || ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "longitude",
            "selector": "(() => { return document.querySelector('meta[property=\"place:location:longitude\"]')?.content || ''; })()",
            "attribute": "text",
            "isJs": true
          }
        ]
      }
    },
    {
      "block_id": "loop-continue-1",
      "block_type": "process",
      "title": "Loop Continue",
      "description": "Continue multi-input loop",
      "position_x": 2136,
      "position_y": 220,
      "config": {
        "color": "bg-[#ff832b]"
      }
    }
  ],
  "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": 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": 1328,
      "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": 1728,
      "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": 2064,
      "position_y": 116,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Scrapes Agoda hotel booking information from provided Agoda hotel detail URLs, including destination, availability/search context, dates, guests, hotel name, URL, address/location, rating text, review score, review count, amenities, highlights, recent booking text, price or sold-out status, and cancellation text. Navigation strategy: known URL list with loop-continue; add more Agoda hotel detail URLs to navigate.urls to scrape additional hotels. Agoda may show cookie/CAPTCHA challenges that require manual handling in the browser.",
      "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-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (destination, available_hotels, start_date, end_date, guests_and_rooms). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 200,
      "width": 340,
      "height": 137,
      "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": 2336,
      "position_y": 200,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}