selenium-query 0.3.1__tar.gz → 0.3.2__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {selenium_query-0.3.1 → selenium_query-0.3.2}/PKG-INFO +1 -1
- {selenium_query-0.3.1 → selenium_query-0.3.2}/pyproject.toml +1 -1
- selenium_query-0.3.2/selenium_query/__version__.py +1 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_basics/base_getter.py +8 -9
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/base_selenium_page.py +2 -2
- selenium_query-0.3.1/selenium_query/__version__.py +0 -1
- {selenium_query-0.3.1 → selenium_query-0.3.2}/LICENSE +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/README.md +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/__init__.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_any_all_getters.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_asserter_getter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_basics/__init__.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_basics/action_getter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_basics/boolean_getter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_basics/generic_value_getter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_filter_getter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_mapper_getter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_negation_transmitter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_order_getter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_types_and_tools.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_values_getter.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/colors.py +0 -0
- {selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/getter.py +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.3.2"
|
|
@@ -140,25 +140,24 @@ class BaseGetter:
|
|
|
140
140
|
return getattr(self.driver, method)(code, *args)
|
|
141
141
|
|
|
142
142
|
|
|
143
|
-
def wait_for_element(self, css_selector, as_=""):
|
|
143
|
+
def wait_for_element(self, css_selector, as_="", *, timeout=None, error=False):
|
|
144
144
|
if self._actions:
|
|
145
145
|
raise ValueError(f"Cannot use `wait_until(...)` on objects with defined ActionChains.")
|
|
146
146
|
|
|
147
|
-
|
|
148
|
-
delta = dt.timedelta(seconds=0.05)
|
|
147
|
+
timeout = timeout and dt.datetime.now() + dt.timedelta(seconds=timeout)
|
|
149
148
|
|
|
150
149
|
def finder(_):
|
|
151
|
-
|
|
150
|
+
if timeout and dt.datetime.now() > timeout:
|
|
151
|
+
if error:
|
|
152
|
+
raise TimeoutError()
|
|
153
|
+
return TimeoutError() # truthy!
|
|
152
154
|
|
|
153
155
|
elt = self.find(css_selector, in_page=True, as_=as_)
|
|
154
156
|
found = elt.exists() and elt
|
|
155
157
|
if found:
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
if dt.datetime.now() - date > delta:
|
|
159
|
-
return found
|
|
158
|
+
elt.pause(0.05).go
|
|
159
|
+
return elt
|
|
160
160
|
return False
|
|
161
|
-
|
|
162
161
|
return self.waiter.until(finder)
|
|
163
162
|
|
|
164
163
|
|
|
@@ -262,8 +262,8 @@ class BaseSeleniumPage:
|
|
|
262
262
|
|
|
263
263
|
|
|
264
264
|
@classmethod
|
|
265
|
-
def wait_for_element(cls, css_selector:str):
|
|
266
|
-
return cls._getter.wait_for_element(css_selector)
|
|
265
|
+
def wait_for_element(cls, css_selector:str, as_="", *, timeout=None, error=False):
|
|
266
|
+
return cls._getter.wait_for_element(css_selector, as_=as_, timeout=timeout, error=error)
|
|
267
267
|
|
|
268
268
|
|
|
269
269
|
@classmethod
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "0.3.1"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{selenium_query-0.3.1 → selenium_query-0.3.2}/selenium_query/_basics/generic_value_getter.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|