✈️ Yatra Flight Fare Comparison Script
This Java-based Selenium automation script scrapes and compares the lowest flight fares for the current and next month on Yatra.com.
📌 Features
- Automatically opens Yatra's flight booking calendar
- Closes promotional pop-up if displayed
- Extracts flight fare data from calendar
- Identifies the lowest fare for both current and next month
- Compares and prints the better fare with a friendly message
🛠 Tech Stack
- Java 8+
- Selenium WebDriver
- ChromeDriver
- Maven (optional but recommended for dependency management)
⚙️ Setup Instructions
-
Clone this repository:
git clone https://github.com/Aayush-Mishraa/Yatra-Calendar-Automation-Solution.git cd Yatra-Calendar-Automation-Solution -
Install dependencies:
- If using Maven, make sure your
pom.xmlincludes:<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.0.0</version> </dependency>
- Download ChromeDriver if not already present. Selenium 4+ automatically manages driver binaries, so manual path setup is not required.
- If using Maven, make sure your
-
Configure ChromeDriver:
- No manual path configuration needed!
Selenium Manager will automatically find and use the correct ChromeDriver version matching your installed Chrome browser.
- No manual path configuration needed!
🚀 Usage
-
Run the Java program:
- Open your terminal and navigate to
src/main/java/com/yatra/automation/. - Compile and run:
javac YatraAutomationScript3.java java com.yatra.automation.YatraAutomationScript3
- Or use your IDE to run
YatraAutomationScript3.java.
- Open your terminal and navigate to
-
View the results:
- The script will print the lowest fares for the current and next month, and indicate which is cheaper.
📂 Project Structure
src/
└── main/
└── java/
└── com/
└── yatra/
└── automation/
└── YatraAutomationScript3.java
🤝 Contributing
Contributions, issues, and feature requests are welcome!
Feel free to check the issues page if you want to contribute.
📄 License
This project is licensed under the MIT License. See the LICENSE file for details.
Tip: For troubleshooting, ensure your Chrome and ChromeDriver versions match. If you encounter element not found errors, check if Yatra.com has updated its UI or calendar widget.