mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
微调
This commit is contained in:
parent
cb5527b18e
commit
8a7363e77d
@ -30,7 +30,7 @@ class BaseParser(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def ele(self, loc_or_ele, mode, timeout):
|
def ele(self, loc_or_ele, mode='single', timeout=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ class BaseElement(BaseParser):
|
|||||||
return True
|
return True
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def ele(self, loc_or_str, mode, timeout):
|
def ele(self, loc_or_str, mode='single', timeout=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
@ -228,7 +228,7 @@ class BasePage(BaseParser):
|
|||||||
@property
|
@property
|
||||||
def title(self) -> Union[str, None]:
|
def title(self) -> Union[str, None]:
|
||||||
"""返回网页title"""
|
"""返回网页title"""
|
||||||
ele = self('x:/html/head/title')
|
ele = self.ele('x:/html/head/title')
|
||||||
return ele.text if ele else None
|
return ele.text if ele else None
|
||||||
|
|
||||||
@property
|
@property
|
||||||
@ -281,7 +281,7 @@ class BasePage(BaseParser):
|
|||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
def ele(self, loc_or_ele, mode, timeout):
|
def ele(self, loc_or_ele, mode='single', timeout=None):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@abstractmethod
|
@abstractmethod
|
||||||
|
@ -318,7 +318,7 @@ class DriverPage(BasePage):
|
|||||||
def to_frame(self, loc_or_ele: Union[int, str, tuple, WebElement, DriverElement] = 'main') -> None:
|
def to_frame(self, loc_or_ele: Union[int, str, tuple, WebElement, DriverElement] = 'main') -> None:
|
||||||
"""跳转到frame \n
|
"""跳转到frame \n
|
||||||
可接收frame序号(0开始)、id或name、查询字符串、loc元组、WebElement对象、DriverElement对象, \n
|
可接收frame序号(0开始)、id或name、查询字符串、loc元组、WebElement对象、DriverElement对象, \n
|
||||||
传入'main'跳到最高层,传入'parent'跳到上一层 \n
|
传入 'main' 跳到最高层,传入 'parent' 跳到上一层 \n
|
||||||
示例: \n
|
示例: \n
|
||||||
to_frame('tag:iframe') - 通过传入frame的查询字符串定位 \n
|
to_frame('tag:iframe') - 通过传入frame的查询字符串定位 \n
|
||||||
to_frame('iframe_id') - 通过frame的id属性定位 \n
|
to_frame('iframe_id') - 通过frame的id属性定位 \n
|
||||||
|
Loading…
x
Reference in New Issue
Block a user