This commit is contained in:
g1879 2021-08-13 22:12:20 +08:00
parent cb5527b18e
commit 8a7363e77d
2 changed files with 5 additions and 5 deletions

View File

@ -30,7 +30,7 @@ class BaseParser(object):
return
@abstractmethod
def ele(self, loc_or_ele, mode, timeout):
def ele(self, loc_or_ele, mode='single', timeout=None):
pass
@ -75,7 +75,7 @@ class BaseElement(BaseParser):
return True
@abstractmethod
def ele(self, loc_or_str, mode, timeout):
def ele(self, loc_or_str, mode='single', timeout=None):
pass
@abstractmethod
@ -228,7 +228,7 @@ class BasePage(BaseParser):
@property
def title(self) -> Union[str, None]:
"""返回网页title"""
ele = self('x:/html/head/title')
ele = self.ele('x:/html/head/title')
return ele.text if ele else None
@property
@ -281,7 +281,7 @@ class BasePage(BaseParser):
pass
@abstractmethod
def ele(self, loc_or_ele, mode, timeout):
def ele(self, loc_or_ele, mode='single', timeout=None):
pass
@abstractmethod

View File

@ -318,7 +318,7 @@ class DriverPage(BasePage):
def to_frame(self, loc_or_ele: Union[int, str, tuple, WebElement, DriverElement] = 'main') -> None:
"""跳转到frame \n
可接收frame序号(0开始)id或name查询字符串loc元组WebElement对象DriverElement对象 \n
传入'main'跳到最高层传入'parent'跳到上一层 \n
传入 'main' 跳到最高层传入 'parent' 跳到上一层 \n
示例 \n
to_frame('tag:iframe') - 通过传入frame的查询字符串定位 \n
to_frame('iframe_id') - 通过frame的id属性定位 \n