celebi-pkg / flight-analysis

Python package to scrape flight data from Google Flights and analyzes prices. Can determine optimal flight from date, place, and price
https://kcelebi.github.io/flight-analysis/
MIT License
127 stars 38 forks source link

Askin for consent + google flights URL doesn't work #13

Closed AntoineAwaida closed 1 year ago

AntoineAwaida commented 1 year ago

Hi,

I've been trying to use your very useful package according to the sort tutorial, but I encounter two issues :

I'm also on MacOS, if this can make any difference.

kcelebi commented 1 year ago

Hello, thank you for bringing up this issue!

This is not something that I've encountered yet, so I'll have to do some research on the consent issue and get back to you. The first thing I would check is whether ChromeDriver is updated to the most recent version (this changes about every month or so).

A couple of questions:

  1. Which flight query are you using?
  2. When you say that it works in regular Chrome/Safari/Vivaldi, are you pasting the url that the package creates into these browsers?
    • If yes, then I would check whether Chrome is updated to latest version. This may not solve the issue because redirecting to the Google Flight homepage is caused by the query being incorrect/unavailable, but it might solve something
  3. Are you using the published 1.1.0 or the 1.1.1-alpha unstable version?
    • I'm currently implementing significant changes to the package in the latter version which might solve the issues you are facing. If you are using the former, I will still investigate but it might be worth waiting until I publish the next version.
  4. Which version of MacOS are you using?
    • I'm using MacOS as well, so this most likely isn't the root but it's worth checking.
AntoineAwaida commented 1 year ago

Hey there, thanks for your answer !

Actually I've found what was going wrong with the URL, in the case of your package and in case of any Google Flight-related package as well.

I'm located in France, Europe, so the date format is DD-MM-YYYY by default here, instead of YYYY-MM-DD. Interestingly, Google Flights' website in Europe expects a DD-MM-YYYY date format in the query fields of the URL.

A quick fix was to change the language settings of my PC to US English to make this package. Obviously there's maybe other solutions as well.

Hope this will help future European users !

kcelebi commented 1 year ago

I'm glad you were able to figure the issue out! I hadn't considered the idea of Google Flights modifying its date format according to Europe/US, I'll look into adding a feature to make this easier!

manueljenni commented 1 year ago

Thanks a lot @AntoineAwaida ! Did you find a fix for the consent issue? (Edit: Other than just programatically accepting it every time)

winchuu commented 9 months ago

Hi! This does not work for me. I changed my laptop and Chrome language setting to US English and the laptop date format to YYYY-mm-dd, but it still asks me for consent for every inquiry.