Skip to content

GFlightScraper is a Node.js tool that scrapes real-time flight data ✈️ from Google Flights using Puppeteer πŸ€–. Just add your flight search links πŸ”—, run the script, and get detailed info like airline, price, timing, and more πŸ’Έ, all saved in JSON format. No API needed. Fast, simple, and powerful.

Notifications You must be signed in to change notification settings

Faheem798/GFlightScraper

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

✈️ GFlightScraper

GitHub top language GitHub repo size Node.js

🧠 An automated flight scraping tool powered by Puppeteer to extract real-time data from Google Flights.


πŸ“¦ Features

  • πŸ” Customizable flight search (origin, destination, dates)
  • 🧭 Headless browser automation using Puppeteer
  • πŸ’Ύ Outputs structured JSON data
  • ✈️ Captures airline, duration, price, stops, and more
  • πŸ” No API required – scrapes live data directly

πŸ“ Project Structure

GFlightScraper/
β”œβ”€β”€ scraper/         # Core Puppeteer scraping logic
β”œβ”€β”€ fileHandler/     # JSON file handling
β”œβ”€β”€ utils/           # Helper utilities
β”œβ”€β”€ main.js          # Main script
β”œβ”€β”€ package.json     # Project dependencies
└── README.md        # Documentation

πŸ› οΈ Installation

# 1. Clone this repository
git clone https://github.com/Faheem798/GFlightScraper.git

# 2. Move into the project folder
cd GFlightScraper

# 3. Install required packages
npm install

πŸš€ How to Use

  1. ✍️ Add your Google Flights links in utils/data.js like this:
module.exports = [
  "https://www.google.com/travel/flights/search?tfs=...&tfu=...",
  "https://www.google.com/travel/flights/search?tfs=...&tfu=...",
  // Add more links as needed
];
  1. ▢️ Run the script:
node main.js
  1. βœ… Check your output:

The scraped data will be saved in the output/ folder as a .json file.


πŸ“„ Sample Output

[
  {
    "airline": "Qatar Airways",
    "price": "$420",
    "departureTime": "02:45 AM",
    "arrivalTime": "10:25 AM",
    "duration": "7h 40m",
    "stops": "1 stop"
  }
]

πŸ§ͺ Development Tips

  • To see browser activity, launch Puppeteer in non-headless mode:
puppeteer.launch({ headless: false });
  • If selectors stop working, inspect the DOM and update the scraping logic accordingly.

🀝 Contributing

Contributions are welcome! πŸ™Œ

# Create a new feature branch
git checkout -b feature/your-feature

# Commit your changes
git commit -m "Add awesome feature"

# Push and create a pull request
git push origin feature/your-feature

πŸ“„ License

This project is licensed under the MIT License.


πŸ’¬ Contact

Made with ❀️ by Faheem
Got questions or suggestions? Open an issue


⚠️ Disclaimer: Google Flights may change its layout or block automated access. Use this tool responsibly and for educational purposes only.

About

GFlightScraper is a Node.js tool that scrapes real-time flight data ✈️ from Google Flights using Puppeteer πŸ€–. Just add your flight search links πŸ”—, run the script, and get detailed info like airline, price, timing, and more πŸ’Έ, all saved in JSON format. No API needed. Fast, simple, and powerful.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published