Skip to content

fix(ctrip): support current flight card DOM#2142

Open
dxxbb wants to merge 1 commit into
jackwener:mainfrom
dxxbb:codex/fix-ctrip-flight-selector
Open

fix(ctrip): support current flight card DOM#2142
dxxbb wants to merge 1 commit into
jackwener:mainfrom
dxxbb:codex/fix-ctrip-flight-selector

Conversation

@dxxbb

@dxxbb dxxbb commented Jul 16, 2026

Copy link
Copy Markdown

Summary

  • support Ctrip's current [data-testid^="flight-item-"] flight cards
  • preserve compatibility with the legacy .flight-list > span > div DOM
  • parse airline, flight number, airports, terminal, price, currency, and cabin from current stable field IDs
  • add a JSDOM regression case based on the current rendered card structure

Root cause

ctrip/flight waited for the legacy card selector, so the command timed out even when the current page had rendered flight results. The new DOM also places the cross-day marker between arrival time and airport and renders the price amount before the currency symbol, so changing only the outer selector would silently produce incorrect fields.

Impact

The command now recognizes both DOM variants and keeps the existing output schema and typed error behavior unchanged.

Validation

  • npx vitest run --project adapter clis/ctrip/ctrip.test.js — 70 passed
  • npm run typecheck — passed
  • npm run check:typed-error-lint — no new violations
  • npm run check:silent-column-drop — no new violations
  • node dist/src/main.js validate ctrip/flight — passed
  • live source run: BJS → SHA, 2026-07-18, returned complete flight rows with prices

Refs #1481

@dxxbb
dxxbb marked this pull request as ready for review July 16, 2026 15:12
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