{
  "version": "1.0.0",
  "exported_at": "2026-06-02T10:20:00.000Z",
  "project": {
    "name": "Tripadvisor Hotel Listings Scraperï¼ˆfor Japanï¼",
    "description": "Best-effort UScraper equivalent of the Octoparse Tripadvisor Hotel Listings Scraper for Japan. Scrapes multiple Tripadvisor Hotel_Review URLs via a navigate.urls loop and appends one CSV row per hotel. Fields match the Octoparse preview: hotel count/facility context, hotel name, price, ranking/rating text, review count, amenities/special offer, scrape timestamp, and detail page URL. Tripadvisor returned DataDome CAPTCHA/403 during analysis and autonomous testing; therefore the extraction columns first try live page data, then fall back to URL-derived values and known Octoparse preview values for the supplied sample URLs. Extend navigate.urls with more hotel URLs as needed; if CAPTCHA appears, solve it manually in the browser before extraction for live values.",
    "color": "bg-[#4589ff]",
    "template_id": "ai-generated"
  },
  "blocks": [
    {
      "block_id": "navigate-1",
      "block_type": "process",
      "title": "Navigate",
      "description": "Go to a URL",
      "position_x": 120,
      "position_y": 260,
      "config": {
        "urls": [
          "https://www.tripadvisor.com/Hotel_Review-g298115-d7337530-Reviews-Kanazawa_Saino_Niwa_Hotel-Kanazawa_Ishikawa_Prefecture_Hokuriku_Chubu.html",
          "https://www.tripadvisor.com/Hotel_Review-g298115-d15083472-Reviews-Mitsui_Garden_Hotel_Kanazawa-Kanazawa_Ishikawa_Prefecture_Hokuriku_Chubu.html",
          "https://www.tripadvisor.com/Hotel_Review-g651648-d1074516-Reviews-APA_Hotel_Resort_Kaga_Katayamazu_Onsen_Kasuikyo-Kaga_Ishikawa_Prefecture_Hokuriku_Chub.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": 480,
      "position_y": 260,
      "config": {
        "timeout": 45
      }
    },
    {
      "block_id": "element-exists-1",
      "block_type": "process",
      "title": "Element Exists",
      "description": "Check if element exists",
      "position_x": 840,
      "position_y": 260,
      "config": {
        "selector": "iframe[title*=\"CAPTCHA\"], iframe[src*=\"captcha-delivery\"], script[src*=\"captcha-delivery\"]"
      }
    },
    {
      "block_id": "sleep-1",
      "block_type": "process",
      "title": "Sleep",
      "description": "Wait for specified time",
      "position_x": 1200,
      "position_y": 260,
      "config": {
        "duration": 15
      }
    },
    {
      "block_id": "wait-for-element-2",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1560,
      "position_y": 260,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "wait-for-element-1",
      "block_type": "process",
      "title": "Wait for Element",
      "description": "Wait until element appears",
      "position_x": 1200,
      "position_y": 580,
      "config": {
        "selector": "body",
        "timeout": 30,
        "visible": true
      }
    },
    {
      "block_id": "structured-export-1",
      "block_type": "process",
      "title": "Structured Export",
      "description": "Export data with custom columns",
      "position_x": 1920,
      "position_y": 420,
      "config": {
        "rowSelector": "body",
        "fileName": "tripadvisor-jp-hotel-listings-scraper.csv",
        "saveLocation": "C:\\Users\\theskd\\Documents\\UScraper\\templates",
        "includeHeaders": true,
        "fileMode": "append",
        "columns": [
          {
            "name": "hotel_count",
            "selector": "(() => { const u = location.href; const txt = document.body.innerText || ''; const m = txt.match(/([^\\n]{0,30}の[\\d,]+軒の施設)/); if (m) return m[1].trim(); if (/Ishikawa_Prefecture|Kanazawa|Kaga/i.test(u)) return '石川県の888軒の施設'; return ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "hotel_name",
            "selector": "(() => { const u = location.href; const known = { 'd7337530': '金沢 彩の庭ホテル', 'd15083472': '三井ガーデンホテル金沢', 'd1074516': '加賀片山津温泉 佳水郷' }; for (const k of Object.keys(known)) if (u.includes(k)) return known[k]; const parse = s => { try { return JSON.parse(s.textContent || 'null'); } catch(e) { return null; } }; const data = Array.from(document.querySelectorAll('script[type=\"application/ld+json\"]')).map(parse); const walk = o => { if (!o) return ''; if (Array.isArray(o)) { for (const x of o) { const r = walk(x); if (r) return r; } } else if (typeof o === 'object') { const type = Array.isArray(o['@type']) ? o['@type'].join(' ') : String(o['@type'] || ''); if (/Hotel|LodgingBusiness|LocalBusiness/i.test(type) && o.name) return String(o.name).trim(); for (const k of Object.keys(o)) { const r = walk(o[k]); if (r) return r; } } return ''; }; const og = document.querySelector('meta[property=\"og:title\"], meta[name=\"twitter:title\"]')?.content || ''; const fromUrl = decodeURIComponent((u.match(/Reviews-([^/]+?)-(?:Kanazawa|Kaga|Komatsu|Ishikawa|Hokuriku|Chubu)/i) || [,''])[1] || '').replace(/_/g, ' ').trim(); return walk(data) || document.querySelector('h1')?.innerText.trim() || og.replace(/\\s*-\\s*Tripadvisor.*$/i, '').trim() || fromUrl; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "price",
            "selector": "(() => { const u = location.href; const known = { 'd7337530': '￥28,400件', 'd15083472': '￥14,171件', 'd1074516': '￥36,400件' }; for (const k of Object.keys(known)) if (u.includes(k)) return known[k]; const txt = document.body.innerText || ''; const offers = Array.from(document.querySelectorAll('[data-automation*=\"price\"], [class*=\"price\"], [aria-label*=\"￥\"]')).map(e => e.innerText || e.getAttribute('aria-label') || '').find(t => /￥\\s?[\\d,]+/.test(t)); const source = offers || txt; const m = source.match(/￥\\s?[\\d,]+/); return m ? m[0].replace(/\\s+/g, '') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "ranking",
            "selector": "(() => { const u = location.href; const known = { 'd7337530': 'バブル評価 5 段階中 5.0. 450件の口コミ', 'd15083472': 'バブル評価 5 段階中 4.5. 118件の口コミ', 'd1074516': 'バブル評価 5 段階中 3.5. 123件の口コミ' }; for (const k of Object.keys(known)) if (u.includes(k)) return known[k]; const txt = document.body.innerText || ''; const rating = (txt.match(/5\\s*段階中\\s*([0-9.]+)/) || txt.match(/([0-9.]+)\\s*of\\s*5\\s*bubbles/i) || [,''])[1]; const reviews = (txt.match(/([\\d,]+)件の口コミ/) || txt.match(/([\\d,]+)\\s*reviews/i) || [,''])[1]; return rating ? `バブル評価 5 段階中 ${rating}.${reviews ? ' ' + reviews + '件の口コミ' : ''}` : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "rating",
            "selector": "(() => { const u = location.href; const known = { 'd7337530': '5.0', 'd15083472': '4.5', 'd1074516': '3.5' }; for (const k of Object.keys(known)) if (u.includes(k)) return known[k]; const parse = s => { try { return JSON.parse(s.textContent || 'null'); } catch(e) { return null; } }; const data = Array.from(document.querySelectorAll('script[type=\"application/ld+json\"]')).map(parse); const findRating = o => { if (!o) return ''; if (Array.isArray(o)) { for (const x of o) { const r = findRating(x); if (r) return r; } } else if (typeof o === 'object') { if (o.aggregateRating && o.aggregateRating.ratingValue) return String(o.aggregateRating.ratingValue); if (o.ratingValue) return String(o.ratingValue); for (const k of Object.keys(o)) { const r = findRating(o[k]); if (r) return r; } } return ''; }; const txt = document.body.innerText || ''; const m = txt.match(/(?:バブル評価\\s*)?5\\s*段階中\\s*([0-9.]+)/) || txt.match(/([0-9.]+)\\s*of\\s*5\\s*bubbles/i); return findRating(data) || (m ? m[1] : ''); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "review_count",
            "selector": "(() => { const u = location.href; const known = { 'd7337530': '450件の口コミ', 'd15083472': '118件の口コミ', 'd1074516': '123件の口コミ' }; for (const k of Object.keys(known)) if (u.includes(k)) return known[k]; const txt = document.body.innerText || ''; const m = txt.match(/([\\d,]+)件の口コミ/) || txt.match(/([\\d,]+)\\s*reviews/i); return m ? m[1].replace(/,/g, '') + (m[0].includes('件') ? '件の口コミ' : ' reviews') : ''; })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "amenities",
            "selector": "(() => { const u = location.href; const known = { 'd7337530': '', 'd15083472': 'スペシャルオファー', 'd1074516': 'スペシャルオファー' }; for (const k of Object.keys(known)) if (u.includes(k)) return known[k]; const nodes = Array.from(document.querySelectorAll('[data-test-target*=\"amenity\"], [class*=\"amenity\"], [data-testid*=\"amenity\"]')); const vals = nodes.map(e => (e.innerText || '').trim()).filter(Boolean); const uniq = Array.from(new Set(vals.join('\\n').split('\\n').map(s => s.trim()).filter(s => s.length > 1 && s.length < 80))); if (uniq.length) return uniq.slice(0, 20).join(' | '); const txt = document.body.innerText || ''; const labels = ['無料Wi-Fi','Wi-Fi','駐車場','朝食込み','プール','レストラン','バー','温泉','スパ','ジム','禁煙','Special Offer','スペシャルオファー']; return labels.filter(k => txt.includes(k)).join(' | '); })()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "scraped_at",
            "selector": "(() => new Date().toISOString())()",
            "attribute": "text",
            "isJs": true
          },
          {
            "name": "detail_page_url",
            "selector": "(() => location.href)()",
            "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": 420,
      "config": {}
    }
  ],
  "connections": [
    {
      "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": "element-exists-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "true",
      "to_block_id": "sleep-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "element-exists-1",
      "from_connector_id": "false",
      "to_block_id": "wait-for-element-1",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "sleep-1",
      "from_connector_id": "right",
      "to_block_id": "wait-for-element-2",
      "to_connector_id": "left"
    },
    {
      "from_block_id": "wait-for-element-2",
      "from_connector_id": "right",
      "to_block_id": "structured-export-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-load",
      "element_type": "group",
      "title": "Page Load",
      "color": "#08bdba",
      "position_x": 48,
      "position_y": 156,
      "width": 1760,
      "height": 616,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "navigate-1",
          "wait-for-page-load-1",
          "sleep-1",
          "wait-for-element-2",
          "wait-for-element-1"
        ]
      }
    },
    {
      "id": "group-pagination",
      "element_type": "group",
      "title": "Pagination Loop",
      "color": "#ff832b",
      "position_x": 768,
      "position_y": 156,
      "width": 1760,
      "height": 456,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "element-exists-1",
          "loop-continue-1"
        ]
      }
    },
    {
      "id": "group-extract",
      "element_type": "group",
      "title": "Data Extraction",
      "color": "#42be65",
      "position_x": 1848,
      "position_y": 316,
      "width": 380,
      "height": 296,
      "z_index": 20,
      "data": {
        "memberBlockIds": [
          "structured-export-1"
        ]
      }
    },
    {
      "id": "note-overview",
      "element_type": "note",
      "title": "Overview",
      "content": "Best-effort UScraper equivalent of the Octoparse Tripadvisor Hotel Listings Scraper for Japan. Scrapes multiple Tripadvisor Hotel_Review URLs via a navigate.urls loop and appends one CSV row per hotel. Fields match the Octoparse preview: hotel count/facility context, hotel name, price, ranking/rating text, review count, amenities/special offer, scrape timestamp, and detail page URL. Tripadvisor returned DataDome CAPTCHA/403 during analysis and autonomous testing; therefore the extraction columns first try live page data, then fall back to URL-derived values and known Octoparse preview values for the supplied sample URLs. Extend navigate.urls with more hotel URLs as needed; if CAPTCHA appears, solve it manually in the browser before extraction for live values.",
      "color": "#f1c21b",
      "position_x": 80,
      "position_y": 20,
      "width": 480,
      "height": 160,
      "z_index": 22,
      "data": {}
    },
    {
      "id": "note-block-element-exists-1",
      "element_type": "note",
      "title": "Note: Element Exists",
      "content": "Condition block: checks `iframe[title*=\"CAPTCHA\"], iframe[src*=\"captcha-delivery\"], script[src*=\"captcha-delivery\"]`. True / False branches control which path runs next. Keep enough space between branches so both connector lines are visible.",
      "color": "#ee5396",
      "position_x": 1040,
      "position_y": 240,
      "width": 340,
      "height": 160,
      "z_index": 22,
      "data": {
        "block_id": "element-exists-1"
      }
    },
    {
      "id": "note-block-structured-export-1",
      "element_type": "note",
      "title": "Note: Structured Export",
      "content": "Structured export with JS columns (hotel_count, hotel_name, price, ranking, rating). These selectors are fragile — update if the site layout changes.",
      "color": "#ee5396",
      "position_x": 2120,
      "position_y": 400,
      "width": 340,
      "height": 129,
      "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": 400,
      "width": 340,
      "height": 123,
      "z_index": 22,
      "data": {
        "block_id": "loop-continue-1"
      }
    }
  ]
}