ctrip-flight-search

Original🇨🇳 Chinese
Translated

Ctrip Flight Query Skill based on browser automation tools, supporting one-way and round-trip flight queries, capable of handling parameter inputs such as departure location, destination, date, etc., and equipped with error recovery mechanisms. Suitable for scenarios where flight information, flight prices, and schedules need to be queried from Ctrip.

2installs
Added on

NPX Install

npx skill4agent add stvlynn/dingtalk-wukong-skills ctrip-flight-search

SKILL.md Content (Chinese)

View Translation Comparison →

Ctrip Flight Query Skill

Function Overview

This skill provides complete automated Ctrip flight query capabilities, based on verified browser operation workflows, supporting the following features:
  • One-way flight query: Query flights from departure to destination on a specified date
  • Round-trip flight query: Query flights with specified round-trip dates (verified support)
  • Multi-city support: Supports input of Chinese city names and airport codes
  • Multi-city universality: Verified to support any city combinations (e.g., Guangzhou→Chengdu, Beijing→Shanghai, etc.)
  • International flight query: Supports international route queries (e.g., Shanghai→Tokyo, Beijing→Seoul, etc.)
  • Date range: Supports date input in YYYY-MM-DD format
  • Error handling: Equipped with handling mechanisms for exceptions such as invisible elements and page changes

Application Scenarios

When users need to:
  • Query flight information for specific dates
  • Obtain flight prices and schedules
  • Automate flight query processes
  • Extract flight data from Ctrip
  • Verify the feasibility of flight queries between different cities

Core Operation SOP Workflow

Basic Query Process

  1. Navigate to Ctrip homepage:
    navigate
    https://www.ctrip.com
  2. Enter flight query page:
    backbone
    → Locate the flight ticket button →
    click
  3. Input departure location:
    type
    → City name →
    search
    → Select specific airport →
    click
  4. Input destination:
    search
    → Target city →
    click
  5. Set date: Confirm that the date input box is correctly set
  6. Execute query:
    press
    Enter
    (preferred solution) or click the search button

Key Operation Points

Departure/Destination Input

  • First use
    type
    to enter the city name in the input box (e.g., "Beijing", "Shanghai", "Guangzhou", "Chengdu", etc.)
  • The system will automatically display a drop-down selection list
  • Use
    search
    to find specific airport options (e.g., "Beijing(Daxing International Airport)(PKX)", "Chengdu(Shuangliu International Airport)(CTU)", etc.)
  • Use
    click
    to select the target airport
  • Multi-city universality: This skill has been verified to support any combination of Chinese city names, including first-tier, second-tier, and third-tier cities

Query Execution Strategy

  • Preferred solution: Use
    press
    +
    Enter
    to submit the form (avoids overlay blocking issues, verified effective in multi-city scenarios)
  • Alternative solution: If the Enter key is invalid, use
    search
    to find the search button and
    click
    it

Error Handling Mechanisms

  • Invisible elements: Try using keyboard operations instead of mouse clicks (keyboard operations are more stable in multi-city tests)
  • Page structure changes: Reuse
    backbone
    or
    search
    to obtain the latest element references after each interaction
  • Input failure: Retry input or use alternative city name formats
  • Dynamic element reference invalidation: This problem is common in multi-city tests, so it is recommended to re-locate elements before each operation

Supported Parameter Formats

Departure/Destination

  • Chinese city names: "Beijing", "Shanghai", "Guangzhou", "Chengdu", "Shenzhen", "Hangzhou" etc. (supports major cities nationwide)
  • International city names: "Tokyo", "Seoul", "Singapore", "Bangkok", "Paris", "London" etc. (supports major international cities)
  • Airport codes: "PEK", "SHA", "CAN", "CTU", "HND", "ICN" etc. (three-letter codes)
  • Full airport names: "Beijing Capital International Airport", "Shanghai Hongqiao International Airport", "Guangzhou Baiyun International Airport", "Chengdu Shuangliu International Airport", "Tokyo Haneda Airport", "Seoul Incheon International Airport" etc.

Date Format

  • Standard format: YYYY-MM-DD (e.g., 2026-03-20)
  • Supported range: Current date and future dates

Flight Type

  • One-way: Supported by default
  • Round-trip: Supports return date parameters (verified)
  • Multi-segment: Complex query scenarios (to be expanded)

Verified Operation Scope

✅ Access Ctrip official website and navigate to flight query page
✅ Input departure city name and select specific airport
✅ Input destination city name and select specific airport
✅ Set query date
✅ Execute flight query and successfully jump to results page
✅ Handle page dynamic changes and element reference updates
Multi-city universality verification: Successfully tested multiple city combinations such as Guangzhou(CAN)→Chengdu(CTU), Beijing(PEK)→Shanghai(SHA) ✅ Keyboard operation stability: Verified the reliability of the Enter key submission strategy in multi-city tests ✅ International flight query verification: Successfully tested the international route Shanghai(SHA)→Tokyo(HND), verifying the universality of international city recognition and query processes

Reference Documents

Detailed operation guides and SOP workflows please refer to: references/操作指南.md

Notes

  1. Page loading time: Ctrip pages may require some loading time, appropriate waiting is needed between operations
  2. Network environment: Ensure stable network connection, Ctrip is accessible stably in China
  3. Browser compatibility: Based on modern browser automation tools, ensure tool version compatibility
  4. Captcha handling: If captcha or login requirements are encountered, manual intervention is required
  5. Multi-city test conclusion: The skill performs consistently across different city combinations, core operation workflow does not need adjustment

Expansion Directions

  • Add support for round-trip flight queries
  • Support cabin class selection (economy class, business class, first class)
  • Add price filtering and sorting functions
  • Support data extraction from flight detail pages
  • Add batch query functions