mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
自动下载chromedriver时显示提示信息
This commit is contained in:
parent
d2df6b041e
commit
db70acfe28
@ -107,11 +107,13 @@ class Drission(object):
|
|||||||
from .easy_set import get_match_driver
|
from .easy_set import get_match_driver
|
||||||
|
|
||||||
chrome_path = self._driver_options.get('binary_location', None) or None
|
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)
|
driver_path = get_match_driver(chrome_path=chrome_path, check_version=False, show_msg=False)
|
||||||
|
|
||||||
if driver_path:
|
if driver_path:
|
||||||
try:
|
try:
|
||||||
self._driver = webdriver.Chrome(driver_path, options=options)
|
self._driver = webdriver.Chrome(driver_path, options=options)
|
||||||
|
print('下载完成。')
|
||||||
except:
|
except:
|
||||||
print('无法启动,请检查chromedriver版本与Chrome是否匹配,并手动设置。')
|
print('无法启动,请检查chromedriver版本与Chrome是否匹配,并手动设置。')
|
||||||
exit(0)
|
exit(0)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user