fangraphs_db.py
def specify_driver():
    """Set Chrome webdriver options and return a diver object."""
    # Set default download directory
    options = webdriver.ChromeOptions()
    prefs = {"download.default_directory": str(Path.cwd() / 'data')}
    options.add_experimental_option("prefs", prefs)

    # Define the executable path fro the Chrome call
    chrome_driver = Path.cwd() / 'chromedriver'

    # Set the load strategy so that it does not wait for adds to load
    cap = DesiredCapabilities.CHROME
    cap["pageLoadStrategy"] = "none"

    if type(chrome_driver) is PosixPath:
        driver = webdriver.Chrome(executable_path=chrome_driver,
                                  options=options,
                                  desired_capabilities=cap)
    else:
        driver = webdriver.Chrome(executable_path=chrome_driver.name,
                                  options=options,
                                  desired_capabilities=cap)

    return driver
Set Chrome webdriver options and return a diver object.
Set Chrome webdriver options and return a diver object.
Set Chrome webdriver options and return a diver object .
def specify_driver():
    options = webdriver.ChromeOptions()
    prefs = {"download.default_directory": str(Path.cwd() / 'data')}
    options.add_experimental_option("prefs", prefs)
    chrome_driver = Path.cwd() / 'chromedriver'
    cap = DesiredCapabilities.CHROME
    cap["pageLoadStrategy"] = "none"
    if type(chrome_driver) is PosixPath:
        driver = webdriver.Chrome(executable_path=chrome_driver,
                                  options=options,
                                  desired_capabilities=cap)
    else:
        driver = webdriver.Chrome(executable_path=chrome_driver.name,
                                  options=options,
                                  desired_capabilities=cap)
    return driver
def specify_driver ( ) : options = webdriver . ChromeOptions ( ) prefs = { "download.default_directory" : str ( Path . cwd ( ) / 'data' ) } options . add_experimental_option ( "prefs" , prefs ) chrome_driver = Path . cwd ( ) / 'chromedriver' cap = DesiredCapabilities . CHROME cap [ "pageLoadStrategy" ] = "none" if type ( chrome_driver ) is PosixPath : driver = webdriver . Chrome ( executable_path = chrome_driver , options = options , desired_capabilities = cap ) else : driver = webdriver . Chrome ( executable_path = chrome_driver . name , options = options , desired_capabilities = cap ) return driver
Set Chrome webdriver options and return a diver object.
Set Chrome webdriver options and return a diver object .
"""Set Chrome webdriver options and return a diver object.""" # Set default download directory
 # Define the executable path fro the Chrome call
 # Set the load strategy so that it does not wait for adds to load
