{
  "version": "1.0.0",
  "exported_at": "2026-06-01T00:00:00.000Z",
  "project": {
    "name": "Booking com Scraper for South Korea",
    "description": "Scrapes Booking.com hotel pages equivalent to the Octoparse Booking template fields: destination, stay dates, guest/room counts, hotel name/link, area/location, distance/transport hints, review text and score, room, bed, remaining-room hints, current option, price, and booking link. Uses a multi-URL navigation loop over Booking hotel URLs from a listing/search result and appends one row per hotel page to booking-com-scraper-for-korea.csv. Price is extracted from visible page pricing when available; if unavailable, the template falls back to Booking's raw pricing block as approximate local-price data rather than labeling it as USD. Booking.com may show CAPTCHA or anti-bot checks; solve manually in the browser if prompted.",
    "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 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.booking.com/hotel/jp/apa-tokyo-nishishinjuku-gochome-eki-tower.ko.html?label=naver-4Vm4fL1MRnMipAD245GNRg&aid=2382110&ucfs=1&arphpl=1&checkin=2023-12-15&checkout=2023-12-20&dest_id=7406&dest_type=district&group_adults=2&req_adults=2&no_rooms=1&group_children=0&req_children=0&hpos=1&hapos=1&sr_order=popularity&srpvid=74674a144fe70041&srepoch=1702463536&all_sr_blocks=276126017_240860026_0_2_0&highlighted_blocks=276126017_240860026_0_2_0&matching_block_id=276126017_240860026_0_2_0&sr_pri_blocks=276126017_240860026_0_2_0__10490000&from_sustainable_property_sr=1&from=searchresults#hotelTmpl",
          "https://www.booking.com/hotel/jp/apa-hotel-shinjuku-kabukicho-tower.ko.html?label=naver-4Vm4fL1MRnMipAD245GNRg&aid=2382110&ucfs=1&arphpl=1&checkin=2023-12-15&checkout=2023-12-20&dest_id=7406&dest_type=district&group_adults=2&req_adults=2&no_rooms=1&group_children=0&req_children=0&hpos=2&hapos=2&sr_order=popularity&srpvid=74674a144fe70041&srepoch=1702463536&all_sr_blocks=140054303_230637862_0_2_0&highlighted_blocks=140054303_230637862_0_2_0&matching_block_id=140054303_230637862_0_2_0&sr_pri_blocks=140054303_230637862_0_2_0__12170000&from_sustainable_property_sr=1&from=searchresults#hotelTmpl",
          "https://www.booking.com/hotel/jp/ici-hotel-ueno-shinokachimachi-by-relief.ko.html?label=naver-4Vm4fL1MRnMipAD245GNRg&aid=2382110&ucfs=1&arphpl=1&checkin=2023-12-15&checkout=2023-12-20&dest_id=7406&dest_type=district&group_adults=2&req_adults=2&no_rooms=1&group_children=0&req_children=0&hpos=3&hapos=3&sr_order=popularity&srpvid=74674a144fe70041&srepoch=1702463536&all_sr_blocks=342996002_0_2_0_0&highlighted_blocks=342996002_0_2_0_0&matching_block_id=342996002_0_2_0_0&sr_pri_blocks=342996002_0_2_0_0__8019353&from=searchresults#hotelTmpl"
        ],
        "color": "bg-[#ff832b]"
      }
    },
    {
      "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": "body",
        "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": 2,
        "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": "booking-com-scraper-for-korea.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "color": "bg-[#42be65]",
        "columns": [
          {
            "name": "destination",
            "selector": "(()=>{const p=new URLSearchParams(location.search); const title=document.title||''; const fromTitle=(title.match(/,\\s*([^,(]+)\\s*\\(/)||[])[1]; const crumbs=[...new Set(Array.from(document.querySelectorAll('a[href*=\"/city/\"], a[href*=\"/district/\"], a[href*=\"/region/\"]')).map(a=>a.textContent.trim()).filter(Boolean))]; return (fromTitle || crumbs.find(x=>/Tokyo|Seoul|Bangkok|도쿄|서울|방콕/i.test(x)) || p.get('ss') || p.get('dest_id') || '').trim();})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "stay_time",
            "selector": "(()=>{const p=new URLSearchParams(location.search); const ci=p.get('checkin')||''; const co=p.get('checkout')||''; return [ci,co].filter(Boolean).join(' — ');})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "guest_and_rooms",
            "selector": "(()=>{const p=new URLSearchParams(location.search); const a=p.get('group_adults')||p.get('req_adults')||''; const c=p.get('group_children')||p.get('req_children')||'0'; const r=p.get('no_rooms')||'1'; const parts=[]; if(a) parts.push('성인 '+a+'명'); if(c!==null) parts.push('아동 '+c+'명'); if(r) parts.push('객실 '+r+'개'); return parts.join(' · ');})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_name",
            "selector": "(()=>{const h2=Array.from(document.querySelectorAll('h2')).map(e=>e.textContent.trim()).find(t=>t && !/Availability|Guest reviews|Hotel area info|Still looking/i.test(t)); const h1=document.querySelector('h1')?.textContent.trim().replace(/\\s*\\(Hotel\\).*$/i,'').replace(/\\s*Deals\\s*$/i,''); const og=document.querySelector('meta[property=\"og:title\"], meta[name=\"og:title\"]')?.content; return h2||h1||og||'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_link",
            "selector": "location.href",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "area",
            "selector": "(()=>{const addr=document.querySelector('[data-testid=\"address\"], .hp_address_subtitle, #showMap2 span, a[href*=\"map_opened-map_trigger_header\"]')?.textContent.trim(); if(addr) return addr.replace(/\\s+/g,' '); const raw=Array.from(document.querySelectorAll('a[href*=\"/country/\"], a[href*=\"/region/\"], a[href*=\"/city/\"], a[href*=\"/district/\"]')).map(a=>a.textContent.trim()).filter(Boolean); const seen=[]; for(const x of raw){ if(!seen.includes(x)) seen.push(x); } return seen.slice(0,4).join(' > ');})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "distance",
            "selector": "(()=>{const t=(document.body.innerText||'').replace(/\\s+/g,' '); const m=t.match(/(\\d+(?:\\.\\d+)?\\s*(?:km|miles?)\\s+from\\s+(?:center|centre)|도심에서\\s*\\d+(?:\\.\\d+)?\\s*km|중심부에서\\s*\\d+(?:\\.\\d+)?\\s*km)/i); return m?m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "transport",
            "selector": "(()=>{const t=(document.body.innerText||'').replace(/\\s+/g,' '); const m=t.match(/(지하철 연결|Subway Access|Metro access|Public transit|대중교통[^.\\n]*)/i); return m?m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_evaluation",
            "selector": "(()=>{const el=document.querySelector('.big_review_score_detailed, .js-hotel-review-score, [data-testid=\"review-score-right-component\"], [data-testid=\"review-score\"]'); const t=(el?.textContent||'').replace(/\\s+/g,' ').trim(); if(!t) return ''; const m=t.match(/(매우 좋음|좋음|우수함|최고|Wonderful|Excellent|Exceptional|Very Good|Good|Pleasant|Average)/i); return m?m[0]:t.replace(/Scored\\s*\\d+(?:\\.\\d+)?/i,'').replace(/\\d+(?:\\.\\d+)?/g,'').replace(/[\\d,]+\\s+reviews?.*$/i,'').trim();})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_score",
            "selector": "(()=>{const el=document.querySelector('.big_review_score_detailed, .js-hotel-review-score, [data-testid=\"review-score-right-component\"], [data-testid=\"review-score\"]'); const t=el?.textContent||''; const m=t.match(/(?:Scored\\s*)?(\\d+(?:\\.\\d+)?)/i); return m?m[1]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "room",
            "selector": "(()=>{const p=new URLSearchParams(location.search); const hb=(p.get('highlighted_blocks')||p.get('matching_block_id')||'').split('_')[0]; const byBlock=hb?document.querySelector('a[href*=\"#RD'+hb+'\"], a[href*=\"RD'+hb+'\"], #RD'+hb+', [data-block-id^=\"'+hb+'\"]'):null; const room=byBlock?.textContent?.trim(); if(room) return room.replace(/\\s+/g,' '); const first=document.querySelector('.hprt-roomtype-link, a[href*=\"#RD\"], a[href*=\"/hotel/\"][href*=\"#RD\"]')?.textContent.trim(); return (first||'').replace(/\\s+/g,' ');})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "bed",
            "selector": "(()=>{const p=new URLSearchParams(location.search); const block=(p.get('highlighted_blocks')||p.get('matching_block_id')||'').split('_')[0]; const row=block?document.querySelector('[data-block-id^=\"'+block+'\"], tr[id*=\"'+block+'\"], tr:has(a[href*=\"#RD'+block+'\"])'):null; const src=(row?.innerText||document.querySelector('#hprt-table, .hprt-table, [data-testid=\"availability-table\"]')?.innerText||document.body.innerText||'').replace(/\\s+/g,' '); const m=src.match(/(\\d+\\s*(?:twin|single|double|full|queen|king|sofa) beds?|싱글침대\\s*\\d+개|더블침대\\s*\\d+개|퀸침대\\s*\\d+개|킹침대\\s*\\d+개)/i); return m?m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "remaining_rooms",
            "selector": "(()=>{const t=(document.body.innerText||'').replace(/\\s+/g,' '); const m=t.match(/(객실\\s*\\d+개\\s*남음|남은\\s*객실\\s*\\d+|Only\\s*\\d+\\s*left|\\d+\\s*rooms?\\s*left)/i); return m?m[0]:'';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_option",
            "selector": "(()=>{const p=new URLSearchParams(location.search); const block=(p.get('highlighted_blocks')||p.get('matching_block_id')||'').split('_')[0]; const row=block?document.querySelector('[data-block-id^=\"'+block+'\"], tr[id*=\"'+block+'\"], tr:has(a[href*=\"#RD'+block+'\"])'):null; const txt=(row?.innerText||document.querySelector('#hprt-table, .hprt-table, [data-testid=\"availability-table\"]')?.innerText||'').replace(/\\s+/g,' ').trim(); return txt.slice(0,500);})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "current_price",
            "selector": "(()=>{const p=new URLSearchParams(location.search); const priceEl=document.querySelector('[data-testid=\"price-and-discounted-price\"], .prco-valign-middle-helper, .bui-price-display__value, .hprt-price-price-standard'); const visible=priceEl?.textContent.trim(); if(visible) return visible.replace(/\\s+/g,' '); const body=document.body.innerText||''; const m=body.match(/(?:US\\$|USD|₩|KRW|¥|JPY)\\s*[\\d,]+(?:\\.\\d+)?/i); if(m) return m[0]; const raw=p.get('sr_pri_blocks')||''; const n=(raw.match(/__(\\d+)/)||[])[1]; if(n) return 'raw_price_block_'+n; return '';})()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "booking_options_link",
            "selector": "(()=>{return location.href.split('#')[0]+'#availability';})()",
            "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-[#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": 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 Booking.com hotel pages equivalent to the Octoparse Booking template fields: destination, stay dates, guest/room counts, hotel name/link, area/location, distance/transport hints, review text and score, room, bed, remaining-room hints, current option, price, and booking link. Uses a multi-URL navigation loop over Booking hotel URLs from a listing/search result and appends one row per hotel page to booking-com-scraper-for-korea.csv. Price is extracted from visible page pricing when available; if unavailable, the template falls back to Booking's raw pricing block as approximate local-price data rather than labeling it as USD. Booking.com may show CAPTCHA or anti-bot checks; solve manually in the browser if prompted.",
      "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, stay_time, guest_and_rooms, hotel_name, hotel_link). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2000,
      "position_y": 200,
      "width": 340,
      "height": 135,
      "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"
      }
    }
  ]
}