Skip to content

Commit a74b443

Browse files
authored
Merge pull request #3127 from seleniumbase/a-fix-an-update-and-dependencies
A fix, an update, and dependencies
2 parents 6a05791 + 5ea2ee8 commit a74b443

File tree

7 files changed

+23
-18
lines changed

7 files changed

+23
-18
lines changed

examples/custom_settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
# Called after self.click(selector), NOT element.click()
4949
WAIT_FOR_RSC_ON_CLICKS = False
5050
# Wait for AngularJS calls to complete after various browser actions.
51-
WAIT_FOR_ANGULARJS = False
51+
WAIT_FOR_ANGULARJS = True
5252
# Skip ALL calls to wait_for_ready_state_complete() and wait_for_angularjs().
5353
SKIP_JS_WAITS = False
5454

requirements.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ six==1.16.0
2323
idna==3.8
2424
chardet==5.2.0
2525
charset-normalizer==3.3.2
26-
urllib3>=1.26.19,<2;python_version<"3.10"
27-
urllib3>=1.26.19,<2.3.0;python_version>="3.10"
26+
urllib3>=1.26.20,<2;python_version<"3.10"
27+
urllib3>=1.26.20,<2.3.0;python_version>="3.10"
2828
requests==2.31.0
2929
pynose==1.5.2
3030
sniffio==1.3.1

seleniumbase/__version__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# seleniumbase package
2-
__version__ = "4.30.5"
2+
__version__ = "4.30.6"

seleniumbase/config/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@
7575
# Called after self.click(selector), NOT element.click()
7676
WAIT_FOR_RSC_ON_CLICKS = False
7777
# Wait for AngularJS calls to complete after various browser actions.
78-
WAIT_FOR_ANGULARJS = False
78+
WAIT_FOR_ANGULARJS = True
7979
# Skip all calls to wait_for_ready_state_complete() and wait_for_angularjs().
8080
SKIP_JS_WAITS = False
8181

seleniumbase/core/browser_launcher.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,10 @@ def _uc_gui_click_captcha(
989989
reconnect_time = 1 # Make it quick (it already failed)
990990
driver.reconnect(reconnect_time)
991991
caught = False
992-
if driver.is_element_present(".footer .clearfix .ray-id"):
992+
if (
993+
driver.is_element_present(".footer .clearfix .ray-id")
994+
and not driver.is_element_present("#challenge-success-text")
995+
):
993996
blind = True
994997
caught = True
995998
if blind:
@@ -1209,7 +1212,10 @@ def _uc_gui_handle_captcha_(driver, frame="iframe", ctype=None):
12091212

12101213
def _uc_gui_handle_captcha(driver, frame="iframe", ctype=None):
12111214
_uc_gui_handle_captcha_(driver, frame=frame, ctype=ctype)
1212-
if driver.is_element_present(".footer .clearfix .ray-id"):
1215+
if (
1216+
driver.is_element_present(".footer .clearfix .ray-id")
1217+
and not driver.is_element_present("#challenge-success-text")
1218+
):
12131219
driver.uc_open_with_reconnect(driver.current_url, 3.8)
12141220
_uc_gui_handle_captcha_(driver, frame=frame, ctype=ctype)
12151221

seleniumbase/fixtures/js_utils.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ def wait_for_ready_state_complete(driver, timeout=settings.LARGE_TIMEOUT):
3838
time.sleep(0.03)
3939
return True
4040
if ready_state == "complete":
41-
time.sleep(0.01) # Better be sure everything is done loading
41+
time.sleep(0.002)
4242
return True
4343
else:
4444
now_ms = time.time() * 1000.0
@@ -61,15 +61,14 @@ def wait_for_angularjs(driver, timeout=settings.LARGE_TIMEOUT, **kwargs):
6161
driver.execute_script("")
6262
except Exception:
6363
pass
64-
if hasattr(driver, "_is_using_uc") and driver._is_using_uc:
65-
# Calling AngularJS waits may make UC Mode detectable.
66-
# Instead, pause for a brief moment, and then return.
67-
time.sleep(0.007)
68-
return
69-
if not settings.WAIT_FOR_ANGULARJS:
64+
if (
65+
(hasattr(driver, "_is_using_uc") and driver._is_using_uc)
66+
or not settings.WAIT_FOR_ANGULARJS
67+
):
68+
wait_for_ready_state_complete(driver)
7069
return
7170
if timeout == settings.MINI_TIMEOUT:
72-
timeout = settings.MINI_TIMEOUT / 4.0
71+
timeout = settings.MINI_TIMEOUT / 6.0
7372
NG_WRAPPER = (
7473
"%(prefix)s"
7574
"var $elm=document.querySelector("
@@ -96,7 +95,7 @@ def wait_for_angularjs(driver, timeout=settings.LARGE_TIMEOUT, **kwargs):
9695
try:
9796
execute_async_script(driver, script, timeout=timeout)
9897
except Exception:
99-
time.sleep(0.0456)
98+
pass
10099

101100

102101
def convert_to_css_selector(selector, by=By.CSS_SELECTOR):

setup.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -171,8 +171,8 @@
171171
"idna==3.8",
172172
'chardet==5.2.0',
173173
'charset-normalizer==3.3.2',
174-
'urllib3>=1.26.19,<2;python_version<"3.10"',
175-
'urllib3>=1.26.19,<2.3.0;python_version>="3.10"',
174+
'urllib3>=1.26.20,<2;python_version<"3.10"',
175+
'urllib3>=1.26.20,<2.3.0;python_version>="3.10"',
176176
'requests==2.31.0',
177177
"pynose==1.5.2",
178178
'sniffio==1.3.1',

0 commit comments

Comments
 (0)