ctrip-flight-search
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinese携程查航班技能
Ctrip Flight Query Skill
功能概述
Function Overview
本技能提供完整的携程航班查询自动化能力,基于实际验证的浏览器操作流程,支持以下功能:
- 单程航班查询: 查询指定日期从出发地到目的地的航班
- 往返航班查询: 查询指定往返日期的航班(已验证支持)
- 多城市支持: 支持中文城市名称和机场代码输入
- 多城市通用性: 已验证支持任意城市组合(如广州→成都、北京→上海等)
- 国际航班查询: 支持国际航线查询(如上海→东京、北京→首尔等)
- 日期范围: 支持YYYY-MM-DD格式的日期输入
- 错误处理: 具备元素不可见、页面变化等异常情况的处理机制
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
核心操作SOP流程
Core Operation SOP Workflow
基础查询流程
Basic Query Process
- 导航到携程首页: →
navigatehttps://www.ctrip.com - 进入航班查询页面: → 定位机票按钮 →
backboneclick - 输入出发地: → 城市名称 →
type→ 选择具体机场 →searchclick - 输入目的地: → 目标城市 →
searchclick - 设置日期: 确认日期输入框已正确设置
- 执行查询: →
press(优先方案)或点击搜索按钮Enter
- Navigate to Ctrip homepage: →
navigatehttps://www.ctrip.com - Enter flight query page: → Locate the flight ticket button →
backboneclick - Input departure location: → City name →
type→ Select specific airport →searchclick - Input destination: → Target city →
searchclick - Set date: Confirm that the date input box is correctly set
- Execute query: →
press(preferred solution) or click the search buttonEnter
关键操作要点
Key Operation Points
出发地/目的地输入
Departure/Destination Input
- 先使用在输入框中输入城市名称(如"北京"、"上海"、"广州"、"成都"等)
type - 系统会自动显示下拉选择列表
- 使用查找具体的机场选项(如"北京(大兴国际机场)(PKX)"、"成都(双流国际机场)(CTU)"等)
search - 使用选择目标机场
click - 多城市通用性: 技能已验证支持任意中文城市名称组合,包括一二三线城市
- First use to enter the city name in the input box (e.g., "Beijing", "Shanghai", "Guangzhou", "Chengdu", etc.)
type - The system will automatically display a drop-down selection list
- Use to find specific airport options (e.g., "Beijing(Daxing International Airport)(PKX)", "Chengdu(Shuangliu International Airport)(CTU)", etc.)
search - Use to select the target airport
click - 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
- 首选方案: 使用+
press提交表单(避免覆盖层阻挡问题,已在多城市场景下验证有效性)Enter - 备选方案: 如果回车键无效,使用查找搜索按钮并
searchclick
- Preferred solution: Use +
pressto submit the form (avoids overlay blocking issues, verified effective in multi-city scenarios)Enter - Alternative solution: If the Enter key is invalid, use to find the search button and
searchitclick
错误处理机制
Error Handling Mechanisms
- 元素不可见: 尝试使用键盘操作替代鼠标点击(键盘操作在多城市测试中表现更稳定)
- 页面结构变化: 每次交互后重新使用或
backbone获取最新元素引用search - 输入失败: 重试输入或使用替代的城市名称格式
- 动态元素引用失效: 在多城市测试中发现此问题普遍存在,建议每次操作前重新定位元素
- Invisible elements: Try using keyboard operations instead of mouse clicks (keyboard operations are more stable in multi-city tests)
- Page structure changes: Reuse or
backboneto obtain the latest element references after each interactionsearch - 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
- 中文城市名: "北京"、"上海"、"广州"、"成都"、"深圳"、"杭州"等(支持全国主要城市)
- 国际城市名: "东京"、"首尔"、"新加坡"、"曼谷"、"巴黎"、"伦敦"等(支持主要国际城市)
- 机场代码: "PEK"、"SHA"、"CAN"、"CTU"、"HND"、"ICN"等(三字代码)
- 完整机场名称: "北京首都国际机场"、"上海虹桥国际机场"、"广州白云国际机场"、"成都双流国际机场"、"东京羽田机场"、"首尔仁川国际机场"等
- 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
- 标准格式: YYYY-MM-DD(如2026-03-20)
- 支持范围: 当前日期及未来日期
- 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
✅ 访问携程官网并导航到航班查询页面
✅ 输入出发地城市名称并选择具体机场
✅ 输入目的地城市名称并选择具体机场
✅ 设置查询日期
✅ 执行航班查询并成功跳转到结果页面
✅ 处理页面动态变化和元素引用更新
✅ 多城市通用性验证: 成功测试广州(CAN)→成都(CTU)、北京(PEK)→上海(SHA)等多种城市组合 ✅ 键盘操作稳定性: 在多城市测试中验证了回车键提交策略的可靠性 ✅ 国际航班查询验证: 成功测试上海(SHA)→东京(HND)国际航线,验证了国际城市识别和查询流程的通用性
✅ 输入出发地城市名称并选择具体机场
✅ 输入目的地城市名称并选择具体机场
✅ 设置查询日期
✅ 执行航班查询并成功跳转到结果页面
✅ 处理页面动态变化和元素引用更新
✅ 多城市通用性验证: 成功测试广州(CAN)→成都(CTU)、北京(PEK)→上海(SHA)等多种城市组合 ✅ 键盘操作稳定性: 在多城市测试中验证了回车键提交策略的可靠性 ✅ 国际航班查询验证: 成功测试上海(SHA)→东京(HND)国际航线,验证了国际城市识别和查询流程的通用性
✅ 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
✅ 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
详细的操作指南和SOP流程请参考:references/操作指南.md
Detailed operation guides and SOP workflows please refer to: references/操作指南.md
注意事项
Notes
- 页面加载时间: 携程页面可能需要一定加载时间,操作间需适当等待
- 网络环境: 确保网络连接正常,携程在国内访问稳定
- 浏览器兼容性: 基于现代浏览器的自动化工具,确保工具版本兼容
- 验证码处理: 如遇验证码或登录要求,需人工干预处理
- 多城市测试结论: 技能在不同城市组合下表现一致,核心操作流程无需调整
- Page loading time: Ctrip pages may require some loading time, appropriate waiting is needed between operations
- Network environment: Ensure stable network connection, Ctrip is accessible stably in China
- Browser compatibility: Based on modern browser automation tools, ensure tool version compatibility
- Captcha handling: If captcha or login requirements are encountered, manual intervention is required
- 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