mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
微调
This commit is contained in:
parent
e7b88c5619
commit
c1454ab0db
@ -10,7 +10,7 @@ from typing import Union
|
|||||||
from requests import Session
|
from requests import Session
|
||||||
from requests.cookies import RequestsCookieJar
|
from requests.cookies import RequestsCookieJar
|
||||||
from selenium import webdriver
|
from selenium import webdriver
|
||||||
from selenium.common.exceptions import SessionNotCreatedException
|
from selenium.common.exceptions import SessionNotCreatedException, WebDriverException
|
||||||
from selenium.webdriver.chrome.options import Options
|
from selenium.webdriver.chrome.options import Options
|
||||||
from selenium.webdriver.chrome.webdriver import WebDriver
|
from selenium.webdriver.chrome.webdriver import WebDriver
|
||||||
from tldextract import extract
|
from tldextract import extract
|
||||||
@ -102,8 +102,8 @@ class Drission(object):
|
|||||||
|
|
||||||
self._driver = webdriver.Chrome(driver_path, options=options)
|
self._driver = webdriver.Chrome(driver_path, options=options)
|
||||||
|
|
||||||
except SessionNotCreatedException:
|
except (WebDriverException, SessionNotCreatedException):
|
||||||
print('Chrome版本与chromedriver版本不匹配,可执行easy_set.get_match_driver()自动下载匹配的版本。')
|
print('未指定chromedriver路径或版本与Chrome不匹配,可执行easy_set.get_match_driver()自动下载匹配的版本。')
|
||||||
exit(0)
|
exit(0)
|
||||||
|
|
||||||
# 反爬设置,似乎没用
|
# 反爬设置,似乎没用
|
||||||
|
Loading…
x
Reference in New Issue
Block a user