# Tongcheng (ly.com / 同程旅行) — Hotel Scraping Field-tested 2026-04-29 against the PC web (`www.ly.com`). Mobile H5 paths not yet mapped. All notes below are PC unless stated otherwise. --- ## TL;DR **Prices are gated behind login. Hotel metadata is not.** - List page returns `prc=null&cury=null` in the result URLs and renders every price as the literal string `¥?` until the user is signed in. - After login (cookies persist in the user's Chrome), the same DOM nodes render real numbers (`¥259 ¥200 ¥59` triplets — see *Price triplet shape*). - Hotel name / address / metro / star / English name / opening + decorate dates are available pre-login from `window.__NUXT__` SSR state. **Practical implication:** `http_get` is useless for prices. You need a browser session AND a logged-in user. `browser-harness` connecting to the user's daily Chrome is the cheapest way — once they log in once via `passport.ly.com`, the cookie sticks across runs. --- ## URL patterns ``` List page: https://www.ly.com/hotel/hotellist?city=&inDate=YYYY-MM-DD&outDate=YYYY-MM-DD Hotel detail page: https://www.ly.com/hotel/hoteldetail?hotelId=&inDate=YYYY-MM-DD&outDate=YYYY-MM-DD Login page (with return URL): https://passport.ly.com/?pageurl= ``` `cityId` is Tongcheng's internal id, not GB code. Shanghai = `321`. Get it by running a search via the home page — the redirect URL contains it. `hotelId` is per-property, stable. Range observed: 8-digit numerics (e.g. `92963586`, `50201258`, `93067902`). The list page also accepts `&keyword=`, `&star=`, etc., but the form fields on `/hotel/` are the canonical entry — fill them or click the search div and let the SPA build the URL. ### Mobile H5 — DO NOT use these (404 in our test) - `https://m.ly.com/scenery/hotel/` — 404 - `https://hotelh5.ly.com/...` — not yet mapped If you need a mobile path, search from `m.ly.com/` instead of guessing. --- ## Search button is NOT a `