Crash in wait_progress_bar
Closed this issue · 2 comments
OrbitalHustler commented
The program crashes in wait_progress_bar. I tried rebooting my WiFi but no luck.
.env file:
# This is a sample .env file.
# Duplicate this file as .env in the root of the project
# and update the environment variables to match your
# desired configuration.
#
# See the README for full descriptions of each of the
# available configurations.
### For debugging and development only.
LOG_LEVEL="DEBUG" # Application log level. Can be any python log level: NOTSET, DEBUG, INFO, WARNING, ERROR, FATAL.
HEADLESS_MODE=true # Run without browser GUI
### Comparator website URL ###
WEBSITE_URL="https://www.kayak.fr" # your locale Kayak website.
WEBSITE_LANGUAGE="fr" # needed to parse dates correctly
NUMBER_OF_RESULTS=3 # How many flight search results to display at the end of the search
### Trip dates and destinations ###
FROM_AIRPORT="YUL" # IATA code of source airport
FROM_ALLOW_NEARBY_AIRPORTS=true # Allow other airports next to your specified source airport
DESTINATION_AIRPORT="MAR" # IATA code of destination airport
DESTINATION_ALLOW_NEARBY_AIRPORTS=true # Allow other airports next to your specified destination airportMIN_NIGHTS=18 # How many nights you want to stay at least
MIN_NIGHTS=28 # How many nights you want to stay at least
MAX_NIGHTS=40 # How many nights you want to stay at most
SEARCH_DATE_BEGIN=2023-01-15
SEARCH_DATE_END=2023-04-15
### Flights preferences ###
MAX_STOPS=2 # maximum number of layovers. 0 is equivalent to a non-stop (direct) flight.
MIN_LAYOVER_DURATION= 0 # Minimum layover duration (waiting time between two flights) in hours (float).
MAX_LAYOVER_DURATION= 10 # Maxumum layover duration in hours (float).
MAX_FLIGHT_DURATION= 40 # Total flight duration (float), including layovers.
### Passengers ###
PASSENGER_ADULTS=1
PASSENGER_STUDENTS=0 # >= 18 years old (a student certificate would be needed)
PASSENGER_SENIORS=0 # >= 65 years old
PASSENGER_YOUTHS=0 # 12 <= age <= 17
PASSENGER_CHILDREN=0 # 2 <= age <= 11
PASSENGER_TODDLERS_IN_OWN_SEAT= 0 # <= 2 years old child in her own seat
PASSENGER_INFANTS_ON_LAP= 0 # <= 2 years old child you would take on your lap
### Bags ###
CARRY_ON_BAG_PER_PASSENGER=1 # How many bags or suitcases per passenger (the little one that generally goes in cabin with you)
CHECKED_BAG_PER_PASSENGER=1 # How many checked bagage per passenger (the big one that generally goes in the hold)
Log:
root@6652538a14:/home/docker/fff# docker compose up
[+] Running 1/1
⠿ Container fff Recreated 0.7s
Attaching to fff
fff | Starting the bot. The scraping will take several minutes depending on your configuration.
fff | 2023-01-12 21:19:56.111 | DEBUG | fff.bot:hide_cookies_disclaimer:209 - Closed the cookie disclaimer
fff | 2023-01-12 21:19:56.112 | DEBUG | fff.bot:generate_urls:122 - Adding URL: https://www.kayak.fr/flights/YUL,nearby-MAR,nearby/2023-01-15/2023-02-18-flexible-calendar-28to35/1adults?fs=bfc=1;cfc=1;layoverdur=-600;legdur=-2400&sort=bestflight_a
fff | 2023-01-12 21:19:56.112 | DEBUG | fff.bot:generate_urls:122 - Adding URL: https://www.kayak.fr/flights/YUL,nearby-MAR,nearby/2023-02-19/2023-03-25-flexible-calendar-28to35/1adults?fs=bfc=1;cfc=1;layoverdur=-600;legdur=-2400&sort=bestflight_a
fff | 2023-01-12 21:19:56.112 | DEBUG | fff.bot:generate_urls:122 - Adding URL: https://www.kayak.fr/flights/YUL,nearby-MAR,nearby/2023-03-26/2023-04-15-flexible-calendar-28to35/1adults?fs=bfc=1;cfc=1;layoverdur=-600;legdur=-2400&sort=bestflight_a
fff | 2023-01-12 21:19:56.113 | DEBUG | fff.bot:generate_urls:122 - Adding URL: https://www.kayak.fr/flights/YUL,nearby-MAR,nearby/2023-01-15/2023-02-18-flexible-calendar-36to40/1adults?fs=bfc=1;cfc=1;layoverdur=-600;legdur=-2400&sort=bestflight_a
fff | 2023-01-12 21:19:56.113 | DEBUG | fff.bot:generate_urls:122 - Adding URL: https://www.kayak.fr/flights/YUL,nearby-MAR,nearby/2023-02-19/2023-03-25-flexible-calendar-36to40/1adults?fs=bfc=1;cfc=1;layoverdur=-600;legdur=-2400&sort=bestflight_a
fff | 2023-01-12 21:19:56.113 | DEBUG | fff.bot:generate_urls:122 - Adding URL: https://www.kayak.fr/flights/YUL,nearby-MAR,nearby/2023-03-26/2023-04-15-flexible-calendar-36to40/1adults?fs=bfc=1;cfc=1;layoverdur=-600;legdur=-2400&sort=bestflight_a
fff | Scraping the website... [URL 1/6]
fff | 2023-01-12 21:20:07.324 | ERROR | fff.main:main:9 - An error has been caught in function 'main', process 'MainProcess' (7), thread 'MainThread' (140404988634944):
fff | Traceback (most recent call last):
fff |
fff | File "<frozen runpy>", line 198, in _run_module_as_main
fff | File "<frozen runpy>", line 88, in _run_code
fff |
fff | File "/usr/src/app/fff/__main__.py", line 10, in <module>
fff | main.main()
fff | │ └ <function main at 0x7fb29556dbc0>
fff | └ <module 'fff.main' from '/usr/src/app/fff/main.py'>
fff |
fff | > File "/usr/src/app/fff/main.py", line 14, in main
fff | bot.search()
fff | │ └ <function Bot.search at 0x7fb29379cfe0>
fff | └ <fff.bot.Bot object at 0x7fb2955b5190>
fff |
fff | File "/usr/src/app/fff/bot.py", line 396, in search
fff | flight_trips = self.get_best_flights(
fff | │ └ <function Bot.get_best_flights at 0x7fb29379cf40>
fff | └ <fff.bot.Bot object at 0x7fb2955b5190>
fff |
fff | File "/usr/src/app/fff/bot.py", line 280, in get_best_flights
fff | departure_dates: List[FlightDateElement] = self._get_best_departure_dates(
fff | │ │ │ └ <function Bot._get_best_departure_dates at 0x7fb29379cea0>
fff | │ │ └ <fff.bot.Bot object at 0x7fb2955b5190>
fff | │ └ <class 'fff.bot.FlightDateElement'>
fff | └ typing.List
fff |
fff | File "/usr/src/app/fff/bot.py", line 270, in _get_best_departure_dates
fff | self.wait_progress_bar()
fff | │ └ <function Bot.wait_progress_bar at 0x7fb29379cd60>
fff | └ <fff.bot.Bot object at 0x7fb2955b5190>
fff |
fff | File "/usr/src/app/fff/bot.py", line 223, in wait_progress_bar
fff | header_containing_progress_bar = self.driver.find_element(
fff | │ │ └ <function WebDriver.find_element at 0x7fb2941a5300>
fff | │ └ <selenium.webdriver.firefox.webdriver.WebDriver (session="e2fa8abb-f9bd-4f63-83e3-8c7f3db1076b")>
fff | └ <fff.bot.Bot object at 0x7fb2955b5190>
fff |
fff | File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 856, in find_element
fff | return self.execute(Command.FIND_ELEMENT, {
fff | │ │ │ └ 'findElement'
fff | │ │ └ <class 'selenium.webdriver.remote.command.Command'>
fff | │ └ <function WebDriver.execute at 0x7fb294197ec0>
fff | └ <selenium.webdriver.firefox.webdriver.WebDriver (session="e2fa8abb-f9bd-4f63-83e3-8c7f3db1076b")>
fff | File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/webdriver.py", line 429, in execute
fff | self.error_handler.check_response(response)
fff | │ │ │ └ {'status': 404, 'value': '{"value":{"error":"no such element","message":"Unable to locate element: //div[contains(@class, \'-...
fff | │ │ └ <function ErrorHandler.check_response at 0x7fb29473d6c0>
fff | │ └ <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7fb293acc0d0>
fff | └ <selenium.webdriver.firefox.webdriver.WebDriver (session="e2fa8abb-f9bd-4f63-83e3-8c7f3db1076b")>
fff | File "/usr/local/lib/python3.11/site-packages/selenium/webdriver/remote/errorhandler.py", line 243, in check_response
fff | raise exception_class(message, screen, stacktrace)
fff | │ │ │ └ ['WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:186:5', 'NoSuchElementError@chrome://remote/content/shar...
fff | │ │ └ None
fff | │ └ "Unable to locate element: //div[contains(@class, '-pres-inline')]"
fff | └ <class 'selenium.common.exceptions.NoSuchElementException'>
fff |
fff | selenium.common.exceptions.NoSuchElementException: Message: Unable to locate element: //div[contains(@class, '-pres-inline')]
fff | Stacktrace:
fff | WebDriverError@chrome://remote/content/shared/webdriver/Errors.jsm:186:5
fff | NoSuchElementError@chrome://remote/content/shared/webdriver/Errors.jsm:398:5
fff | element.find/</<@chrome://remote/content/marionette/element.js:300:16
fff |
fff exited with code 0
Merinorus commented
Hey,
MAR
airport is in Maracaibo (Venezuela) and some sanctions are applied for now:
https://home.treasury.gov/policy-issues/financial-sanctions/sanctions-programs-and-country-information
https://home.treasury.gov/policy-issues/financial-sanctions/sanctions-programs-and-country-information/venezuela-related-sanctions
This is why Kayak isn't working for this destination.
Did you mean MRS
airport (Marseille)? ;)
OrbitalHustler commented
Thanks for the fast reply! That's very saddening, I really wanted to visit the beautiful city of Maracaibo.
I'll check out this Marseille thing, thanks