-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Added --workers to adjust pool thread workers for Thread Pool Scraper - Adjusted default pool thread workers to 5 - Use Firefox instead of Chrome - Adjusted wait time for clicking pop-up ad and load more result button while scrolling down to 0.1 seconds - Adjust WebDriver Wait poll frequency to 0 - Adjusted scroll-down length to 2,000 pixels - Use logging instead of loguru - Adjusted scripts to use the same logger for all scrapers - Added driver wait for clicking 'load more result' button - Fixed 'check_if_current_date_has_passed' function bug for Month End Scraper - Added more tests - Added logic to check in case the past year is entered for Thread Pool and Month End scraper - Added timezone parameter for Thread Pool and Month End scrapers so that they check the past date based on the entered timezone, mostly for fixing timezone problems when testing using GitHub Action - Added timezone parameter for 'check_if_current_date_has_passed' mostly for fixing timezone problems when testing using GitHub Action - Adjusted log message - Added ElementClickInterceptedException handler when clicking pop-up ad and the load more result button - Added NoSuchWindowException handler while scrolling down the browser window - Added finally block to ensure that the driver is closed - Handle case when HTML content is None. - Add CSS selector list for clicking load more result button - Adjusted save data process - Removed Month End scraper - Added check_missing_dates.py
- Loading branch information
Showing
5 changed files
with
60 additions
and
100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
import argparse | ||
|
||
from japan_avg_hotel_price_finder.configure_logging import configure_logging_with_file | ||
from japan_avg_hotel_price_finder.utils import check_in_db_if_all_date_was_scraped, \ | ||
check_in_csv_dir_if_all_date_was_scraped | ||
|
||
logger = configure_logging_with_file('jp_hotel_data.log', 'jp_hotel_data') | ||
|
||
parser = argparse.ArgumentParser(description='Parser that control which kind of missing dates checkers to use.') | ||
parser.add_argument('--check_db', type=str, default=False, help='Check missing dates in database') | ||
parser.add_argument('--check_csv', type=str, default=False, help='Check missing dates in CSV file directory') | ||
|
||
args = parser.parse_args() | ||
|
||
if args.check_db: | ||
db = args.check_db | ||
check_in_db_if_all_date_was_scraped(db=db, to_sqlite=True) | ||
elif args.check_csv: | ||
directory = args.check_csv | ||
directory = str(directory) | ||
check_in_csv_dir_if_all_date_was_scraped(directory) | ||
else: | ||
logger.warning('Please use --check_db or --check_csv') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters