feat(adapters): 汽车之家二手车 (che168) browse/car + autohome spec + guazi brand search#2010
Open
yixin-1024 wants to merge 2 commits into
Open
feat(adapters): 汽车之家二手车 (che168) browse/car + autohome spec + guazi brand search#2010yixin-1024 wants to merge 2 commits into
yixin-1024 wants to merge 2 commits into
Conversation
Follow-up to the no-login car adapters (jackwener#2009), adding the surfaces that open up once you're browsing in a logged-in Chrome. che168 (汽车之家二手车 / 二手车之家) — 3 commands: - spec 🌐 public — full trim parameter sheet via the GBK cache API (cacheapigo.che168.com/CarProduct/GetParam.ashx); this is the clean, numeric config data autohome.com.cn hides behind rotating font-glyph obfuscation, so it fills the gap the autohome adapter left open. - browse 🔐 browser — used cars for sale in a city. The list/detail pages - car 🔐 browser are 瑞数(Riversafe)-gated, so a bare fetch only gets the challenge shell; they're read through the logged-in browser (Strategy.COOKIE) where the challenge clears, then the rendered DOM is extracted. Pure extractors, unit-tested against fixtures. guazi search — brand-filtered used-car search (宝马/比亚迪/理想…) on the same no-login mobile SSR that browse uses (m.guazi.com/<city>/<brand>/). The desktop www.guazi.com brand pages render the same data but sit behind a captcha that trips on direct navigation even when logged in, so the reliable route is the mobile SSR. Reuses the shared parseListings. All commands live-validated against the real sites. 22 adapter tests, tsc clean, doc-coverage 172/172, zero new silent-column-drop / typed-error. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The new-car 参数配置 cache (cacheapigo.che168.com/CarProduct/GetParam) is 汽车之家-group data served unsigned and login-free — conceptually a sibling of the existing no-login `autohome brand`/`score`, not the browser-gated che168 used-car adapter. Relocate it so che168 is purely used-car (browse/car) and `autohome` owns every no-login 汽车之家 surface. - new clis/autohome/spec.js (site: autohome); PARAM_API / SPEC_COLUMNS / normalizeSpecId / paramGetJson moved into autohome/utils.js - che168/utils.js stripped to the used-car surface; header reworded - param.json fixture + parseParams/normalizeSpecId tests moved che168 -> autohome - docs: spec section moved to autohome.md; autohome's stale "no per-trim config" note corrected; cli-manifest.json regenerated - autohome + che168 adapter tests green (19); live `autohome spec 39616` verified Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Follow-up to the no-login Chinese car adapters (#2009): the logged-in-Chrome used-car surfaces of 汽车之家二手车 (
che168), a newautohome spectrim-config command, and a brand-filtered guazi search.汽车之家二手车 / 二手车之家 (
che168) — new site, 2 commandsche168 browse [city]che168 car <url>The used-car list/detail pages are 瑞数 (Riversafe)-gated — a bare
fetchonly gets the ~29KB challenge shell — sobrowse/carrun in the logged-in browser (Strategy.COOKIE), where the challenge clears, and extract the rendered DOM. The DOM extractors are pure top-level functions, unit-tested against frozen fixtures.汽车之家 (
autohome) —spec, full trim configautohome spec <specid>returns the full parameter sheet (基本参数 / 车身 / 发动机 / 变速箱 / 底盘 / 制动) — the clean, numeric config thatautohome.com.cnitself hides behind rotating font-glyph obfuscation and a signed API. It reads the same 汽车之家 group's unsigned 车168 cache (cacheapigo.che168.com/CarProduct/GetParam.ashx, GBK JSON), so it's login-free and needs no browser.It lives under
autohome(notche168) on purpose: it's a no-login 汽车之家 surface, a sibling of the existingautohome brand/score, so it belongs with them rather than in the browser-gated used-car adapter. This closes the per-trim-config gap theautohomeadapter previously left open.瓜子二手车 (
guazi) —search, brand-filteredguazi search <brand> [--city]filters by brand (宝马 / 比亚迪 / 理想 …, Chinese name or guazi slug) using the brand-filtered mobile SSR pathm.guazi.com/<city>/<brand>/— the same no-login, no-signature surfacebrowsealready uses. (The desktopwww.guazi.combrand pages render the same data but sit behind a captcha that trips on direct navigation even when logged in, so the mobile SSR is the reliable route.) Reuses the sharedparseListings.Notes
autohome spec/guazi searchare login-free;che168 browse/carneed a logged-in Chrome via the OpenCLI browser bridge (the 瑞数 challenge only clears in a real, warmed-up browser).autohomeseriesId ≠ specid (two id namespaces):spectakes the specid from a/spec/<id>/URL orspecid=param;scoretakes the seriesId.citycolumn always reflects each car's real location, so results are never silently mislabeled.Testing
specparser /normalizeSpecId).autohome spec 39616→ 宝马3系 full parameter sheet).tscclean · doc-coverage 172/172 · zero new silent-column-drop / typed-error-lint.🤖 Generated with Claude Code