mirror of
https://gitee.com/g1879/DrissionPage.git
synced 2024-12-10 04:00:23 +08:00
d模式查找元素timeout支持0秒
This commit is contained in:
parent
adb1952d9f
commit
6421b43aa9
@ -585,7 +585,7 @@ def execute_driver_find(page_or_ele,
|
||||
driver = page_or_ele.driver
|
||||
|
||||
try:
|
||||
if timeout and timeout != page.timeout:
|
||||
if timeout is not None and timeout != page.timeout:
|
||||
wait = WebDriverWait(driver, timeout=timeout)
|
||||
else:
|
||||
page.wait._driver = driver
|
||||
|
@ -199,7 +199,7 @@ class DriverPage(object):
|
||||
else:
|
||||
raise ValueError('Argument loc_or_str can only be tuple, str, DriverElement, DriverElement.')
|
||||
|
||||
timeout = timeout or self.timeout
|
||||
timeout = timeout if timeout is not None else self.timeout
|
||||
return execute_driver_find(self, loc_or_ele, mode, timeout)
|
||||
|
||||
def eles(self,
|
||||
|
@ -379,7 +379,7 @@ class MixPage(Null, SessionPage, DriverPage):
|
||||
if self._mode == 's':
|
||||
return super().ele(loc_or_ele, mode=mode)
|
||||
elif self._mode == 'd':
|
||||
timeout = timeout or self.timeout
|
||||
timeout = timeout if timeout is not None else self.timeout
|
||||
return super(SessionPage, self).ele(loc_or_ele, mode=mode, timeout=timeout)
|
||||
|
||||
def eles(self,
|
||||
|
Loading…
x
Reference in New Issue
Block a user