mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
MixPage的__init__()的drission参数可接收's'或'd',以简易方式创建对象
This commit is contained in:
parent
f3f4be5793
commit
50f2130f9c
@ -32,12 +32,15 @@ class MixPage(Null, SessionPage, DriverPage):
|
||||
这些功能由DriverPage和SessionPage类实现。
|
||||
"""
|
||||
|
||||
def __init__(self, drission: Drission = None, mode: str = 'd', timeout: float = 10):
|
||||
def __init__(self, drission: Union[Drission, str] = None, mode: str = 'd', timeout: float = 10):
|
||||
"""初始化函数
|
||||
:param drission: 整合了driver和session的类
|
||||
:param drission: 整合了driver和session的类,传入's'或'd'时快速配置相应模式
|
||||
:param mode: 默认使用selenium的d模式
|
||||
"""
|
||||
super().__init__()
|
||||
if drission in ['s', 'd']:
|
||||
mode = drission
|
||||
drission = None
|
||||
self._drission = drission or Drission()
|
||||
self._session = None
|
||||
self._driver = None
|
||||
|
Loading…
x
Reference in New Issue
Block a user