mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
修复eles的bug
This commit is contained in:
parent
4c24a57537
commit
c962e21163
@ -14,7 +14,7 @@ from selenium.webdriver.remote.webelement import WebElement
|
||||
from selenium.webdriver.support import expected_conditions as ec
|
||||
from selenium.webdriver.support.wait import WebDriverWait
|
||||
|
||||
from .common import DrissionElement, get_loc_from_str, translate_loc_to_xpath, get_available_file_name
|
||||
from .common import DrissionElement, get_loc_from_str, get_available_file_name
|
||||
|
||||
|
||||
class DriverElement(DrissionElement):
|
||||
@ -196,7 +196,7 @@ class DriverElement(DrissionElement):
|
||||
:param show_errmsg: 出现异常时是否打印信息
|
||||
:return: DriverElement对象组成的列表
|
||||
"""
|
||||
if not isinstance(loc_or_str, tuple) or not isinstance(loc_or_str, str):
|
||||
if not isinstance(loc_or_str, tuple) and not isinstance(loc_or_str, str):
|
||||
raise TypeError('Type of loc_or_str can only be tuple or str.')
|
||||
return self.ele(loc_or_str, mode='all', show_errmsg=show_errmsg, timeout=timeout)
|
||||
|
||||
|
@ -14,7 +14,7 @@ from selenium.common.exceptions import NoAlertPresentException
|
||||
from selenium.webdriver.chrome.webdriver import WebDriver
|
||||
from selenium.webdriver.remote.webelement import WebElement
|
||||
|
||||
from .common import get_loc_from_str, get_available_file_name, translate_loc_to_xpath
|
||||
from .common import get_loc_from_str, get_available_file_name
|
||||
from .driver_element import DriverElement, execute_driver_find
|
||||
|
||||
|
||||
@ -147,7 +147,7 @@ class DriverPage(object):
|
||||
:param show_errmsg: 出现异常时是否打印信息
|
||||
:return: DriverElement对象组成的列表
|
||||
"""
|
||||
if not isinstance(loc_or_str, tuple) or not isinstance(loc_or_str, str):
|
||||
if not isinstance(loc_or_str, tuple) and not isinstance(loc_or_str, str):
|
||||
raise TypeError('Type of loc_or_str can only be tuple or str.')
|
||||
return self.ele(loc_or_str, mode='all', timeout=timeout, show_errmsg=show_errmsg)
|
||||
|
||||
|
@ -167,7 +167,7 @@ class SessionElement(DrissionElement):
|
||||
:param show_errmsg: 出现异常时是否打印信息
|
||||
:return: SessionElement对象组成的列表
|
||||
"""
|
||||
if not isinstance(loc_or_str, tuple) or not isinstance(loc_or_str, str):
|
||||
if not isinstance(loc_or_str, tuple) and not isinstance(loc_or_str, str):
|
||||
raise TypeError('Type of loc_or_str can only be tuple or str.')
|
||||
return self.ele(loc_or_str, mode='all', show_errmsg=show_errmsg)
|
||||
|
||||
|
@ -133,7 +133,7 @@ class SessionPage(object):
|
||||
:param show_errmsg: 出现异常时是否打印信息
|
||||
:return: SessionElement对象组成的列表
|
||||
"""
|
||||
if not isinstance(loc_or_str, tuple) or not isinstance(loc_or_str, str):
|
||||
if not isinstance(loc_or_str, tuple) and not isinstance(loc_or_str, str):
|
||||
raise TypeError('Type of loc_or_str can only be tuple or str.')
|
||||
return self.ele(loc_or_str, mode='all', show_errmsg=True)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user