!9 修复d模式元素获取子元素失败的bug

Merge pull request !9 from g1879/develop
This commit is contained in:
g1879 2020-12-11 16:40:39 +08:00 committed by Gitee
commit af2f2e2f45
2 changed files with 4 additions and 3 deletions

View File

@ -10,7 +10,7 @@ from typing import Union
from requests import Session
from requests.cookies import RequestsCookieJar
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.webdriver import WebDriver
from tldextract import extract
@ -102,8 +102,8 @@ class Drission(object):
self._driver = webdriver.Chrome(driver_path, options=options)
except SessionNotCreatedException:
print('Chrome版本与chromedriver版本不匹配可执行easy_set.get_match_driver()自动下载匹配的版本。')
except (WebDriverException, SessionNotCreatedException):
print('未指定chromedriver路径或版本与Chrome不匹配可执行easy_set.get_match_driver()自动下载匹配的版本。')
exit(0)
# 反爬设置,似乎没用

View File

@ -586,6 +586,7 @@ def execute_driver_find(page_or_ele,
if timeout and timeout != page.timeout:
wait = WebDriverWait(driver, timeout=timeout)
else:
page.wait._driver = driver
wait = page.wait
if loc[0] == 'xpath':