自动下载chromedriver时显示提示信息

This commit is contained in:
g1879 2021-01-09 16:21:45 +08:00
parent d2df6b041e
commit db70acfe28

View File

@ -107,11 +107,13 @@ class Drission(object):
from .easy_set import get_match_driver
chrome_path = self._driver_options.get('binary_location', None) or None
print('自动下载chromedriver...')
driver_path = get_match_driver(chrome_path=chrome_path, check_version=False, show_msg=False)
if driver_path:
try:
self._driver = webdriver.Chrome(driver_path, options=options)
print('下载完成。')
except:
print('无法启动请检查chromedriver版本与Chrome是否匹配并手动设置。')
exit(0)