Skip to content

Commit

Permalink
Language fixed to US English, added chrome_installer to help with chr…
Browse files Browse the repository at this point in the history
…omedriver installation
  • Loading branch information
kcelebi committed Jun 11, 2023
1 parent c7c8c43 commit 67c75e9
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
7 changes: 4 additions & 3 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
tqdm
numpy
pandas==2.0.1
pandas
selenium
pytest==7.2.2
sqlalchemy
pytest
sqlalchemy
chromedriver_autoinstaller
2 changes: 2 additions & 0 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ install_requires =
numpy
pandas
selenium
sqlalchemy
chromedriver_autoinstaller

[options.packages.find]
where = src
Expand Down
5 changes: 3 additions & 2 deletions src/google_flight_analysis/scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from selenium.webdriver.support.ui import WebDriverWait
from selenium.common.exceptions import TimeoutException
from selenium.webdriver.common.by import By
import chromedriver_autoinstaller
from datetime import date, datetime, timedelta
import numpy as np
import pandas as pd
Expand All @@ -28,7 +29,7 @@ def ScrapeObjects(objs, copy_objs = False):
if type(objs) is _Scrape:
objs = [objs]

driver = webdriver.Chrome()
chromedriver_autoinstaller.install() # check if chromedriver is installed correctly and on path
driver.maximize_window()

# modifies the objects in-place
Expand Down Expand Up @@ -267,7 +268,7 @@ def _make_url(self):
urls = []
for i in range(len(self._date)):
urls += [
'https://www.google.com/travel/flights?q=Flights%20to%20{org}%20from%20{dest}%20on%20{date}%20oneway'.format(
'https://www.google.com/travel/flights?hl=en&q=Flights%20to%20{org}%20from%20{dest}%20on%20{date}%20oneway'.format(
dest = self._dest[i],
org = self._origin[i],
date = self._date[i]
Expand Down

0 comments on commit 67c75e9

Please sign in to comment.