Skip to content

feat(adapters): 汽车之家二手车 (che168) browse/car + autohome spec + guazi brand search#2010

Open
yixin-1024 wants to merge 2 commits into
jackwener:mainfrom
yixin-1024:feat/car-adapters-followup
Open

feat(adapters): 汽车之家二手车 (che168) browse/car + autohome spec + guazi brand search#2010
yixin-1024 wants to merge 2 commits into
jackwener:mainfrom
yixin-1024:feat/car-adapters-followup

Conversation

@yixin-1024

@yixin-1024 yixin-1024 commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

What

Follow-up to the no-login Chinese car adapters (#2009): the logged-in-Chrome used-car surfaces of 汽车之家二手车 (che168), a new autohome spec trim-config command, and a brand-filtered guazi search.

汽车之家二手车 / 二手车之家 (che168) — new site, 2 commands

Command Mode What
che168 browse [city] 🔐 Browser Used cars for sale in a city → price / registration / mileage.
che168 car <url> 🔐 Browser One listing's detail → price, down payment, registration, mileage, gearbox, transfers, location.

The used-car list/detail pages are 瑞数 (Riversafe)-gated — a bare fetch only gets the ~29KB challenge shell — so browse/car run 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 config

autohome spec <specid> returns the full parameter sheet (基本参数 / 车身 / 发动机 / 变速箱 / 底盘 / 制动) — the clean, numeric config that autohome.com.cn itself 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 (not che168) on purpose: it's a no-login 汽车之家 surface, a sibling of the existing autohome brand / score, so it belongs with them rather than in the browser-gated used-car adapter. This closes the per-trim-config gap the autohome adapter previously left open.

瓜子二手车 (guazi) — search, brand-filtered

guazi search <brand> [--city] filters by brand (宝马 / 比亚迪 / 理想 …, Chinese name or guazi slug) using the brand-filtered mobile SSR path m.guazi.com/<city>/<brand>/ — the same no-login, no-signature surface browse already uses. (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 mobile SSR is the reliable route.) Reuses the shared parseListings.

Notes

  • autohome spec / guazi search are login-free; che168 browse / car need a logged-in Chrome via the OpenCLI browser bridge (the 瑞数 challenge only clears in a real, warmed-up browser).
  • autohome seriesId ≠ specid (two id namespaces): spec takes the specid from a /spec/<id>/ URL or specid= param; score takes the seriesId.
  • Sparse-inventory brand pages on guazi pad with nearby/national listings; the city column always reflects each car's real location, so results are never silently mislabeled.

Testing

  • 32 adapter unit tests against frozen real-data fixtures (che168 5, guazi 13, autohome 14 incl. the moved spec parser / normalizeSpecId).
  • Every command live-validated against the real sites (incl. autohome spec 39616 → 宝马3系 full parameter sheet).
  • tsc clean · doc-coverage 172/172 · zero new silent-column-drop / typed-error-lint.

🤖 Generated with Claude Code

yixin-1024 and others added 2 commits June 24, 2026 11:00
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>
@yixin-1024 yixin-1024 changed the title feat(adapters): 汽车之家二手车 (che168) + guazi brand search feat(adapters): 汽车之家二手车 (che168) browse/car + autohome spec + guazi brand search Jun 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant