Skip to content

Commit f3e8e45

Browse files
committed
driver.uc_click(selector) needs a backup JS option
1 parent 7eb6efe commit f3e8e45

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

seleniumbase/core/browser_launcher.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
import urllib3
1111
import warnings
1212
from selenium import webdriver
13+
from selenium.common.exceptions import ElementClickInterceptedException
1314
from selenium.webdriver.chrome.service import Service as ChromeService
1415
from selenium.webdriver.common.options import ArgOptions
1516
from selenium.webdriver.common.service import utils as service_utils
@@ -429,7 +430,10 @@ def uc_click(
429430
driver, selector, by="css selector", timeout=settings.SMALL_TIMEOUT
430431
):
431432
element = driver.wait_for_element(selector, by=by, timeout=timeout)
432-
element.uc_click()
433+
try:
434+
element.uc_click()
435+
except ElementClickInterceptedException:
436+
driver.js_click(selector, by=by, timeout=timeout)
433437

434438

435439
def edgedriver_on_path():

0 commit comments

Comments
 (0)