Merge pull request #3127 from seleniumbase/a-fix-an-update-and-dependencies
A fix, an update, and dependencies
This commit is contained in:
commit
a74b443501
|
@ -48,7 +48,7 @@ WAIT_FOR_RSC_ON_PAGE_LOADS = True
|
||||||
# Called after self.click(selector), NOT element.click()
|
# Called after self.click(selector), NOT element.click()
|
||||||
WAIT_FOR_RSC_ON_CLICKS = False
|
WAIT_FOR_RSC_ON_CLICKS = False
|
||||||
# Wait for AngularJS calls to complete after various browser actions.
|
# Wait for AngularJS calls to complete after various browser actions.
|
||||||
WAIT_FOR_ANGULARJS = False
|
WAIT_FOR_ANGULARJS = True
|
||||||
# Skip ALL calls to wait_for_ready_state_complete() and wait_for_angularjs().
|
# Skip ALL calls to wait_for_ready_state_complete() and wait_for_angularjs().
|
||||||
SKIP_JS_WAITS = False
|
SKIP_JS_WAITS = False
|
||||||
|
|
||||||
|
|
|
@ -23,8 +23,8 @@ six==1.16.0
|
||||||
idna==3.8
|
idna==3.8
|
||||||
chardet==5.2.0
|
chardet==5.2.0
|
||||||
charset-normalizer==3.3.2
|
charset-normalizer==3.3.2
|
||||||
urllib3>=1.26.19,<2;python_version<"3.10"
|
urllib3>=1.26.20,<2;python_version<"3.10"
|
||||||
urllib3>=1.26.19,<2.3.0;python_version>="3.10"
|
urllib3>=1.26.20,<2.3.0;python_version>="3.10"
|
||||||
requests==2.31.0
|
requests==2.31.0
|
||||||
pynose==1.5.2
|
pynose==1.5.2
|
||||||
sniffio==1.3.1
|
sniffio==1.3.1
|
||||||
|
|
|
@ -1,2 +1,2 @@
|
||||||
# seleniumbase package
|
# seleniumbase package
|
||||||
__version__ = "4.30.5"
|
__version__ = "4.30.6"
|
||||||
|
|
|
@ -75,7 +75,7 @@ WAIT_FOR_RSC_ON_PAGE_LOADS = True
|
||||||
# Called after self.click(selector), NOT element.click()
|
# Called after self.click(selector), NOT element.click()
|
||||||
WAIT_FOR_RSC_ON_CLICKS = False
|
WAIT_FOR_RSC_ON_CLICKS = False
|
||||||
# Wait for AngularJS calls to complete after various browser actions.
|
# Wait for AngularJS calls to complete after various browser actions.
|
||||||
WAIT_FOR_ANGULARJS = False
|
WAIT_FOR_ANGULARJS = True
|
||||||
# Skip all calls to wait_for_ready_state_complete() and wait_for_angularjs().
|
# Skip all calls to wait_for_ready_state_complete() and wait_for_angularjs().
|
||||||
SKIP_JS_WAITS = False
|
SKIP_JS_WAITS = False
|
||||||
|
|
||||||
|
|
|
@ -989,7 +989,10 @@ def _uc_gui_click_captcha(
|
||||||
reconnect_time = 1 # Make it quick (it already failed)
|
reconnect_time = 1 # Make it quick (it already failed)
|
||||||
driver.reconnect(reconnect_time)
|
driver.reconnect(reconnect_time)
|
||||||
caught = False
|
caught = False
|
||||||
if driver.is_element_present(".footer .clearfix .ray-id"):
|
if (
|
||||||
|
driver.is_element_present(".footer .clearfix .ray-id")
|
||||||
|
and not driver.is_element_present("#challenge-success-text")
|
||||||
|
):
|
||||||
blind = True
|
blind = True
|
||||||
caught = True
|
caught = True
|
||||||
if blind:
|
if blind:
|
||||||
|
@ -1209,7 +1212,10 @@ def _uc_gui_handle_captcha_(driver, frame="iframe", ctype=None):
|
||||||
|
|
||||||
def _uc_gui_handle_captcha(driver, frame="iframe", ctype=None):
|
def _uc_gui_handle_captcha(driver, frame="iframe", ctype=None):
|
||||||
_uc_gui_handle_captcha_(driver, frame=frame, ctype=ctype)
|
_uc_gui_handle_captcha_(driver, frame=frame, ctype=ctype)
|
||||||
if driver.is_element_present(".footer .clearfix .ray-id"):
|
if (
|
||||||
|
driver.is_element_present(".footer .clearfix .ray-id")
|
||||||
|
and not driver.is_element_present("#challenge-success-text")
|
||||||
|
):
|
||||||
driver.uc_open_with_reconnect(driver.current_url, 3.8)
|
driver.uc_open_with_reconnect(driver.current_url, 3.8)
|
||||||
_uc_gui_handle_captcha_(driver, frame=frame, ctype=ctype)
|
_uc_gui_handle_captcha_(driver, frame=frame, ctype=ctype)
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ def wait_for_ready_state_complete(driver, timeout=settings.LARGE_TIMEOUT):
|
||||||
time.sleep(0.03)
|
time.sleep(0.03)
|
||||||
return True
|
return True
|
||||||
if ready_state == "complete":
|
if ready_state == "complete":
|
||||||
time.sleep(0.01) # Better be sure everything is done loading
|
time.sleep(0.002)
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
now_ms = time.time() * 1000.0
|
now_ms = time.time() * 1000.0
|
||||||
|
@ -61,15 +61,14 @@ def wait_for_angularjs(driver, timeout=settings.LARGE_TIMEOUT, **kwargs):
|
||||||
driver.execute_script("")
|
driver.execute_script("")
|
||||||
except Exception:
|
except Exception:
|
||||||
pass
|
pass
|
||||||
if hasattr(driver, "_is_using_uc") and driver._is_using_uc:
|
if (
|
||||||
# Calling AngularJS waits may make UC Mode detectable.
|
(hasattr(driver, "_is_using_uc") and driver._is_using_uc)
|
||||||
# Instead, pause for a brief moment, and then return.
|
or not settings.WAIT_FOR_ANGULARJS
|
||||||
time.sleep(0.007)
|
):
|
||||||
return
|
wait_for_ready_state_complete(driver)
|
||||||
if not settings.WAIT_FOR_ANGULARJS:
|
|
||||||
return
|
return
|
||||||
if timeout == settings.MINI_TIMEOUT:
|
if timeout == settings.MINI_TIMEOUT:
|
||||||
timeout = settings.MINI_TIMEOUT / 4.0
|
timeout = settings.MINI_TIMEOUT / 6.0
|
||||||
NG_WRAPPER = (
|
NG_WRAPPER = (
|
||||||
"%(prefix)s"
|
"%(prefix)s"
|
||||||
"var $elm=document.querySelector("
|
"var $elm=document.querySelector("
|
||||||
|
@ -96,7 +95,7 @@ def wait_for_angularjs(driver, timeout=settings.LARGE_TIMEOUT, **kwargs):
|
||||||
try:
|
try:
|
||||||
execute_async_script(driver, script, timeout=timeout)
|
execute_async_script(driver, script, timeout=timeout)
|
||||||
except Exception:
|
except Exception:
|
||||||
time.sleep(0.0456)
|
pass
|
||||||
|
|
||||||
|
|
||||||
def convert_to_css_selector(selector, by=By.CSS_SELECTOR):
|
def convert_to_css_selector(selector, by=By.CSS_SELECTOR):
|
||||||
|
|
4
setup.py
4
setup.py
|
@ -171,8 +171,8 @@ setup(
|
||||||
"idna==3.8",
|
"idna==3.8",
|
||||||
'chardet==5.2.0',
|
'chardet==5.2.0',
|
||||||
'charset-normalizer==3.3.2',
|
'charset-normalizer==3.3.2',
|
||||||
'urllib3>=1.26.19,<2;python_version<"3.10"',
|
'urllib3>=1.26.20,<2;python_version<"3.10"',
|
||||||
'urllib3>=1.26.19,<2.3.0;python_version>="3.10"',
|
'urllib3>=1.26.20,<2.3.0;python_version>="3.10"',
|
||||||
'requests==2.31.0',
|
'requests==2.31.0',
|
||||||
"pynose==1.5.2",
|
"pynose==1.5.2",
|
||||||
'sniffio==1.3.1',
|
'sniffio==1.3.1',
|
||||||
|
|
Loading…
Reference in New Issue