AWeirdDev / flights

Fast, robust Google Flights scraper (API) for Python. (Probably)
https://pypi.org/project/fast-flights
35 stars 9 forks source link

No flights found #17

Closed LetThereBeQE closed 4 weeks ago

LetThereBeQE commented 1 month ago

Hi, getting error: RuntimeError: No flights found. (preflight checked) Possible reasons:

Am getting this for a very simplified version of the readme code for a flight I am certain exists. Any idea what might be wrong?

`from fast_flights import FlightData, Passengers, create_filter, get_flights

filter = create_filter( flight_data=[

Include more if it's not a one-way trip

    FlightData(
        date="2024-11-15",  # Date of departure
        from_airport="LAX", 
        to_airport="SFO"
    ),
    # ... include more for round trips
],
trip="one-way",  # Trip (round-trip, one-way)
seat="economy",  # Seat (economy, premium-economy, business or first)
passengers=Passengers(
    adults=1,
),

)

result = get_flights(filter)

print("The price is currently", result.current_price)`

jack-ireland commented 1 month ago

It could be an issue with cookies. I ran while using a VPN - putting me in the US - and it worked for me.