Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions examples/cdp_mode/playwright/raw_walmart_sync.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,10 @@
and description.inner_text() not in unique_item
):
unique_item.append(description.inner_text())
print("* " + description.inner_text())
price = item.locator('[data-automation-id="product-price"]')
if price.count() > 0:
print("* " + description.inner_text())
price_text = price.inner_text()
price_text = price_text.split("current price Now ")[-1]
price_text = price.inner_text().strip()
price_text = price_text.split("current price ")[-1]
price_text = price_text.split(" ")[0]
price_text = price_text.replace("\n", " ")
print(" (" + price_text + ")")
6 changes: 2 additions & 4 deletions examples/cdp_mode/raw_cdp_walmart.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,8 @@
'[data-automation-id="product-price"]'
)
if price:
price_text = price.text
price_text = price_text.split("current price Now ")[-1]
price_text = price.text.strip()
price_text = price_text.split("current price ")[-1]
price_text = price_text.split(" ")[0]
print(" (" + price_text + ")")
item.scroll_into_view()
item.scroll_into_view()
sb.quit()
6 changes: 2 additions & 4 deletions examples/cdp_mode/raw_walmart.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,7 @@
'[data-automation-id="product-price"]'
)
if price:
price_text = price.text
price_text = price_text.split("current price Now ")[-1]
price_text = price.text.strip()
price_text = price_text.split("current price ")[-1]
price_text = price_text.split(" ")[0]
print(" (" + price_text + ")")
item.scroll_into_view()
item.scroll_into_view()
2 changes: 1 addition & 1 deletion seleniumbase/__version__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# seleniumbase package
__version__ = "4.52.0"
__version__ = "4.52.1"
16 changes: 10 additions & 6 deletions seleniumbase/fixtures/js_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,16 @@ def wait_for_ready_state_complete(driver, timeout=settings.LARGE_TIMEOUT):


def execute_async_script(driver, script, timeout=settings.LARGE_TIMEOUT):
if hasattr(driver, "set_script_timeout"):
driver.set_script_timeout(timeout)
if hasattr(driver, "execute_async_script"):
return driver.execute_async_script(script)
else:
return None
try:
if hasattr(driver, "set_script_timeout"):
driver.set_script_timeout(timeout)
if hasattr(driver, "execute_async_script"):
return driver.execute_async_script(script)
else:
return None
finally:
if hasattr(driver, "set_script_timeout"):
driver.set_script_timeout(30) # Restore default


def wait_for_angularjs(driver, timeout=settings.LARGE_TIMEOUT, **kwargs):
Expand Down