mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
微调
This commit is contained in:
parent
b3dc7814e4
commit
9dde6b4ce7
@ -53,8 +53,7 @@ def set_paths(driver_path: str = None,
|
||||
om = OptionsManager(ini_path)
|
||||
|
||||
def format_path(path: str) -> str:
|
||||
if isinstance(path, str):
|
||||
return path.replace('/', '\\')
|
||||
return str(path).replace('/', '\\')
|
||||
|
||||
if driver_path is not None:
|
||||
om.set_item('paths', 'chromedriver_path', format_path(driver_path))
|
||||
@ -169,7 +168,7 @@ def check_driver_version(driver_path: str = None, chrome_path: str = None) -> bo
|
||||
print('正在检测可用性...')
|
||||
om = OptionsManager()
|
||||
driver_path = driver_path or om.get_value('paths', 'chromedriver_path') or 'chromedriver'
|
||||
chrome_path = chrome_path or om.get_value('chrome_options', 'binary_location')
|
||||
chrome_path = str(chrome_path or om.get_value('chrome_options', 'binary_location'))
|
||||
do = DriverOptions(read_file=False)
|
||||
do.add_argument('--headless')
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user