Pre Merge pull request !41 from g1879/dev

This commit is contained in:
g1879 2024-01-29 15:44:07 +00:00 committed by Gitee
commit e2fd987238
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
4 changed files with 4 additions and 4 deletions

View File

@ -14,4 +14,4 @@ from ._configs.chromium_options import ChromiumOptions
from ._configs.session_options import SessionOptions
__all__ = ['ChromiumPage', 'ChromiumOptions', 'SessionOptions', 'SessionPage', 'WebPage', '__version__']
__version__ = '4.0.4.2'
__version__ = '4.0.4.3'

View File

@ -405,7 +405,7 @@ class BasePage(BaseParser):
:return: 重试次数间隔是否文件组成的tuple
"""
is_file = False
if isinstance(url, Path) or '://' not in url or ':\\\\' not in url:
if isinstance(url, Path) or ('://' not in url and ':\\\\' not in url):
p = Path(url)
if p.exists():
url = str(p.absolute())

View File

@ -668,7 +668,7 @@ class ChromiumBase(BasePage):
if ele:
self.run_cdp('DOM.removeNode', nodeId=ele._node_id)
def add_ele(self, outerHTML, insert_to, before=None):
def add_ele(self, outerHTML, insert_to=None, before=None):
"""新建一个元素
:param outerHTML: 新元素的html文本
:param insert_to: 插入到哪个元素中可接收元素对象和定位符为None添加到body

View File

@ -216,7 +216,7 @@ class ChromiumBase(BasePage):
def add_ele(self,
outerHTML: str,
insert_to: Optional[ChromiumElement, str, Tuple[str, str]],
insert_to: Optional[ChromiumElement, str, Tuple[str, str]] = None,
before: Optional[ChromiumElement, str, Tuple[str, str]] = None) -> ChromiumElement: ...
def get_frame(self, loc_ind_ele: Union[str, int, tuple, ChromiumFrame], timeout: float = None) -> ChromiumFrame: ...