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
from selenium import webdriver | |
from bs4 import BeautifulSoup | |
import pandas as pd | |
import html | |
import datetime | |
def initialize_driver(): | |
options = webdriver.ChromeOptions() | |
options.add_argument('--headless=new') |
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
def load_config(): | |
try: | |
default_url = 'localhost:8080' | |
url = config.get('url', default_url) | |
return url | |
except: | |
log.warning('failed to load config key: url') | |
return default_url |
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
def _get_remote_config_value(self, path: str) -> str: | |
try: | |
_, resp = self._config_client.kv.get(path) | |
val = resp['Value'].decode() | |
return val | |
except Exception as e: | |
print(f'Fail to get remote configuration for key = {path}') | |
raise e |