seleniumbase 4.41.1__py3-none-any.whl → 4.41.3__py3-none-any.whl
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.
- seleniumbase/__version__.py +1 -1
- seleniumbase/core/browser_launcher.py +7 -2
- seleniumbase/core/sb_cdp.py +146 -0
- {seleniumbase-4.41.1.dist-info → seleniumbase-4.41.3.dist-info}/METADATA +8 -6
- {seleniumbase-4.41.1.dist-info → seleniumbase-4.41.3.dist-info}/RECORD +9 -9
- {seleniumbase-4.41.1.dist-info → seleniumbase-4.41.3.dist-info}/WHEEL +0 -0
- {seleniumbase-4.41.1.dist-info → seleniumbase-4.41.3.dist-info}/entry_points.txt +0 -0
- {seleniumbase-4.41.1.dist-info → seleniumbase-4.41.3.dist-info}/licenses/LICENSE +0 -0
- {seleniumbase-4.41.1.dist-info → seleniumbase-4.41.3.dist-info}/top_level.txt +0 -0
seleniumbase/__version__.py
CHANGED
@@ -1,2 +1,2 @@
|
|
1
1
|
# seleniumbase package
|
2
|
-
__version__ = "4.41.
|
2
|
+
__version__ = "4.41.3"
|
@@ -762,6 +762,7 @@ def uc_open_with_cdp_mode(driver, url=None, **kwargs):
|
|
762
762
|
cdp.gui_write = CDPM.gui_write
|
763
763
|
cdp.gui_click_x_y = CDPM.gui_click_x_y
|
764
764
|
cdp.gui_click_element = CDPM.gui_click_element
|
765
|
+
cdp.gui_click_captcha = CDPM.gui_click_captcha
|
765
766
|
cdp.gui_drag_drop_points = CDPM.gui_drag_drop_points
|
766
767
|
cdp.gui_drag_and_drop = CDPM.gui_drag_and_drop
|
767
768
|
cdp.gui_click_and_hold = CDPM.gui_click_and_hold
|
@@ -3136,7 +3137,9 @@ def get_driver(
|
|
3136
3137
|
proxy_string, proxy_scheme = proxy_helper.validate_proxy_string(
|
3137
3138
|
proxy_string, keep_scheme=True
|
3138
3139
|
)
|
3139
|
-
if
|
3140
|
+
if proxy_user and not proxy_pass:
|
3141
|
+
proxy_pass = ""
|
3142
|
+
if proxy_string and proxy_user:
|
3140
3143
|
proxy_auth = True
|
3141
3144
|
elif proxy_pac_url:
|
3142
3145
|
username_and_password = None
|
@@ -3163,7 +3166,9 @@ def get_driver(
|
|
3163
3166
|
)
|
3164
3167
|
if not proxy_pac_url.lower().endswith(".pac"):
|
3165
3168
|
raise Exception('The proxy PAC URL must end with ".pac"!')
|
3166
|
-
if
|
3169
|
+
if proxy_user and not proxy_pass:
|
3170
|
+
proxy_pass = ""
|
3171
|
+
if proxy_pac_url and proxy_user:
|
3167
3172
|
proxy_auth = True
|
3168
3173
|
if (
|
3169
3174
|
is_using_uc(undetectable, browser_name)
|
seleniumbase/core/sb_cdp.py
CHANGED
@@ -1629,6 +1629,152 @@ class CDPMethods():
|
|
1629
1629
|
self.__slow_mode_pause_if_set()
|
1630
1630
|
self.loop.run_until_complete(self.page.wait())
|
1631
1631
|
|
1632
|
+
def _on_a_cf_turnstile_page(self):
|
1633
|
+
source = self.get_page_source()
|
1634
|
+
if (
|
1635
|
+
'data-callback="onCaptchaSuccess"' in source
|
1636
|
+
or "/challenge-platform/scripts/" in source
|
1637
|
+
or 'id="challenge-widget-' in source
|
1638
|
+
or "cf-turnstile-" in source
|
1639
|
+
):
|
1640
|
+
return True
|
1641
|
+
return False
|
1642
|
+
|
1643
|
+
def gui_click_captcha(self):
|
1644
|
+
if not self._on_a_cf_turnstile_page():
|
1645
|
+
return
|
1646
|
+
selector = None
|
1647
|
+
if (
|
1648
|
+
self.is_element_present('[name*="cf-turnstile-"]')
|
1649
|
+
and self.is_element_present("#challenge-form div > div")
|
1650
|
+
):
|
1651
|
+
selector = "#challenge-form div > div"
|
1652
|
+
elif (
|
1653
|
+
self.is_element_present('[name*="cf-turnstile-"]')
|
1654
|
+
and self.is_element_present(
|
1655
|
+
'[style="display: grid;"] div div'
|
1656
|
+
)
|
1657
|
+
):
|
1658
|
+
selector = '[style="display: grid;"] div div'
|
1659
|
+
elif (
|
1660
|
+
self.is_element_present('[name*="cf-turnstile-"]')
|
1661
|
+
and self.is_element_present("[class*=spacer] + div div")
|
1662
|
+
):
|
1663
|
+
selector = '[class*=spacer] + div div'
|
1664
|
+
elif (
|
1665
|
+
self.is_element_present('[name*="cf-turnstile-"]')
|
1666
|
+
and self.is_element_present("div.spacer div")
|
1667
|
+
):
|
1668
|
+
selector = "div.spacer div"
|
1669
|
+
elif (
|
1670
|
+
self.is_element_present('script[src*="challenges.c"]')
|
1671
|
+
and self.is_element_present(
|
1672
|
+
'[data-testid*="challenge-"] div'
|
1673
|
+
)
|
1674
|
+
):
|
1675
|
+
selector = '[data-testid*="challenge-"] div'
|
1676
|
+
elif self.is_element_present(
|
1677
|
+
"div#turnstile-widget div:not([class])"
|
1678
|
+
):
|
1679
|
+
selector = "div#turnstile-widget div:not([class])"
|
1680
|
+
elif self.is_element_present(
|
1681
|
+
'form div:not([class]):has(input[name*="cf-turn"])'
|
1682
|
+
):
|
1683
|
+
selector = 'form div:not([class]):has(input[name*="cf-turn"])'
|
1684
|
+
elif (
|
1685
|
+
self.is_element_present('[src*="/turnstile/"]')
|
1686
|
+
and self.is_element_present("form div:not(:has(*))")
|
1687
|
+
):
|
1688
|
+
selector = "form div:not(:has(*))"
|
1689
|
+
elif (
|
1690
|
+
self.is_element_present('[src*="/turnstile/"]')
|
1691
|
+
and self.is_element_present(
|
1692
|
+
"body > div#check > div:not([class])"
|
1693
|
+
)
|
1694
|
+
):
|
1695
|
+
selector = "body > div#check > div:not([class])"
|
1696
|
+
elif self.is_element_present(".cf-turnstile-wrapper"):
|
1697
|
+
selector = ".cf-turnstile-wrapper"
|
1698
|
+
elif self.is_element_present('[class="cf-turnstile"]'):
|
1699
|
+
selector = '[class="cf-turnstile"]'
|
1700
|
+
elif self.is_element_present(
|
1701
|
+
'[data-callback="onCaptchaSuccess"]'
|
1702
|
+
):
|
1703
|
+
selector = '[data-callback="onCaptchaSuccess"]'
|
1704
|
+
else:
|
1705
|
+
return
|
1706
|
+
if not selector:
|
1707
|
+
return
|
1708
|
+
if (
|
1709
|
+
self.is_element_present("form")
|
1710
|
+
and (
|
1711
|
+
self.is_element_present('form[class*="center"]')
|
1712
|
+
or self.is_element_present('form[class*="right"]')
|
1713
|
+
or self.is_element_present('form div[class*="center"]')
|
1714
|
+
or self.is_element_present('form div[class*="right"]')
|
1715
|
+
)
|
1716
|
+
):
|
1717
|
+
script = (
|
1718
|
+
"""var $elements = document.querySelectorAll(
|
1719
|
+
'form[class], form div[class]');
|
1720
|
+
var index = 0, length = $elements.length;
|
1721
|
+
for(; index < length; index++){
|
1722
|
+
the_class = $elements[index].getAttribute('class');
|
1723
|
+
new_class = the_class.replaceAll('center', 'left');
|
1724
|
+
new_class = new_class.replaceAll('right', 'left');
|
1725
|
+
$elements[index].setAttribute('class', new_class);}"""
|
1726
|
+
)
|
1727
|
+
with suppress(Exception):
|
1728
|
+
self.loop.run_until_complete(self.page.evaluate(script))
|
1729
|
+
self.loop.run_until_complete(self.page.wait())
|
1730
|
+
elif (
|
1731
|
+
self.is_element_present("form")
|
1732
|
+
and (
|
1733
|
+
self.is_element_present('form div[style*="center"]')
|
1734
|
+
or self.is_element_present('form div[style*="right"]')
|
1735
|
+
)
|
1736
|
+
):
|
1737
|
+
script = (
|
1738
|
+
"""var $elements = document.querySelectorAll(
|
1739
|
+
'form[style], form div[style]');
|
1740
|
+
var index = 0, length = $elements.length;
|
1741
|
+
for(; index < length; index++){
|
1742
|
+
the_style = $elements[index].getAttribute('style');
|
1743
|
+
new_style = the_style.replaceAll('center', 'left');
|
1744
|
+
new_style = new_style.replaceAll('right', 'left');
|
1745
|
+
$elements[index].setAttribute('style', new_style);}"""
|
1746
|
+
)
|
1747
|
+
with suppress(Exception):
|
1748
|
+
self.loop.run_until_complete(self.page.evaluate(script))
|
1749
|
+
self.loop.run_until_complete(self.page.wait())
|
1750
|
+
elif (
|
1751
|
+
self.is_element_present("form")
|
1752
|
+
and self.is_element_present(
|
1753
|
+
'form [id*="turnstile"] > div:not([class])'
|
1754
|
+
)
|
1755
|
+
):
|
1756
|
+
script = (
|
1757
|
+
"""var $elements = document.querySelectorAll(
|
1758
|
+
'form [id*="turnstile"]');
|
1759
|
+
var index = 0, length = $elements.length;
|
1760
|
+
for(; index < length; index++){
|
1761
|
+
$elements[index].setAttribute('align', 'left');}"""
|
1762
|
+
)
|
1763
|
+
with suppress(Exception):
|
1764
|
+
self.loop.run_until_complete(self.page.evaluate(script))
|
1765
|
+
self.loop.run_until_complete(self.page.wait())
|
1766
|
+
with suppress(Exception):
|
1767
|
+
element_rect = self.get_gui_element_rect(selector, timeout=1)
|
1768
|
+
e_x = element_rect["x"]
|
1769
|
+
e_y = element_rect["y"]
|
1770
|
+
x = e_x + 32
|
1771
|
+
if not shared_utils.is_windows():
|
1772
|
+
y = e_y + 32
|
1773
|
+
else:
|
1774
|
+
y = e_y + 22
|
1775
|
+
sb_config._saved_cf_x_y = (x, y)
|
1776
|
+
self.gui_click_x_y(x, y)
|
1777
|
+
|
1632
1778
|
def __gui_drag_drop(self, x1, y1, x2, y2, timeframe=0.25, uc_lock=False):
|
1633
1779
|
self.__install_pyautogui_if_missing()
|
1634
1780
|
import pyautogui
|
@@ -1,6 +1,6 @@
|
|
1
1
|
Metadata-Version: 2.4
|
2
2
|
Name: seleniumbase
|
3
|
-
Version: 4.41.
|
3
|
+
Version: 4.41.3
|
4
4
|
Summary: A complete web automation framework for end-to-end testing.
|
5
5
|
Home-page: https://github.com/seleniumbase/SeleniumBase
|
6
6
|
Author: Michael Mintz
|
@@ -77,7 +77,7 @@ Requires-Dist: fasteners>=0.20
|
|
77
77
|
Requires-Dist: mycdp>=1.2.0
|
78
78
|
Requires-Dist: pynose>=1.5.4
|
79
79
|
Requires-Dist: platformdirs>=4.3.6; python_version < "3.9"
|
80
|
-
Requires-Dist: platformdirs>=4.
|
80
|
+
Requires-Dist: platformdirs>=4.4.0; python_version >= "3.9"
|
81
81
|
Requires-Dist: typing-extensions>=4.13.2
|
82
82
|
Requires-Dist: sbvirtualdisplay>=1.4.0
|
83
83
|
Requires-Dist: MarkupSafe==2.1.5; python_version < "3.9"
|
@@ -97,7 +97,8 @@ Requires-Dist: chardet==5.2.0
|
|
97
97
|
Requires-Dist: charset-normalizer<4,>=3.4.3
|
98
98
|
Requires-Dist: urllib3<2,>=1.26.20; python_version < "3.10"
|
99
99
|
Requires-Dist: urllib3<2.6.0,>=1.26.20; python_version >= "3.10"
|
100
|
-
Requires-Dist: requests==2.32.4
|
100
|
+
Requires-Dist: requests==2.32.4; python_version < "3.9"
|
101
|
+
Requires-Dist: requests<2.33,>=2.32.5; python_version >= "3.9"
|
101
102
|
Requires-Dist: sniffio==1.3.1
|
102
103
|
Requires-Dist: h11==0.16.0
|
103
104
|
Requires-Dist: outcome==1.3.0.post0
|
@@ -127,8 +128,9 @@ Requires-Dist: pytest-xdist==3.6.1; python_version < "3.9"
|
|
127
128
|
Requires-Dist: pytest-xdist==3.8.0; python_version >= "3.9"
|
128
129
|
Requires-Dist: parameterized==0.9.0
|
129
130
|
Requires-Dist: behave==1.2.6
|
130
|
-
Requires-Dist: soupsieve==2.7
|
131
|
-
Requires-Dist:
|
131
|
+
Requires-Dist: soupsieve==2.7; python_version < "3.9"
|
132
|
+
Requires-Dist: soupsieve~=2.8; python_version >= "3.9"
|
133
|
+
Requires-Dist: beautifulsoup4~=4.13.5
|
132
134
|
Requires-Dist: pyotp==2.9.0
|
133
135
|
Requires-Dist: python-xlib==0.33; platform_system == "Linux"
|
134
136
|
Requires-Dist: markdown-it-py==3.0.0; python_version < "3.10"
|
@@ -141,7 +143,7 @@ Requires-Dist: allure-python-commons>=2.13.5; extra == "allure"
|
|
141
143
|
Requires-Dist: allure-behave>=2.13.5; extra == "allure"
|
142
144
|
Provides-Extra: coverage
|
143
145
|
Requires-Dist: coverage>=7.6.1; python_version < "3.9" and extra == "coverage"
|
144
|
-
Requires-Dist: coverage>=7.10.
|
146
|
+
Requires-Dist: coverage>=7.10.5; python_version >= "3.9" and extra == "coverage"
|
145
147
|
Requires-Dist: pytest-cov>=5.0.0; python_version < "3.9" and extra == "coverage"
|
146
148
|
Requires-Dist: pytest-cov>=6.2.1; python_version >= "3.9" and extra == "coverage"
|
147
149
|
Provides-Extra: flake8
|
@@ -3,7 +3,7 @@ sbase/__main__.py,sha256=G0bVB1-DM4PGwQ1KyOupaWCs4ePbChZNNWuX2htim5U,647
|
|
3
3
|
sbase/steps.py,sha256=EdJyNVJ1yxoHsc7qp8kzx0EESIkOh_033yLCvmaPcs4,43281
|
4
4
|
seleniumbase/__init__.py,sha256=JFEY9P5QJqsa1M6ghzLMH2eIPQyh85iglCaQwg8Y8z4,2498
|
5
5
|
seleniumbase/__main__.py,sha256=dn1p6dgCchmcH1zzTzzQvFwwdQQqnTGH6ULV9m4hv24,654
|
6
|
-
seleniumbase/__version__.py,sha256=
|
6
|
+
seleniumbase/__version__.py,sha256=33QQxeiCJzToF77JtyOR29kdfFS__rlg8PAf8rlqs9M,46
|
7
7
|
seleniumbase/behave/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
8
8
|
seleniumbase/behave/behave_helper.py,sha256=f4CdiSSYM3gMAicSKWJInkVGFwpGXtHMD8fikTehopQ,24291
|
9
9
|
seleniumbase/behave/behave_sb.py,sha256=guLihFsr1uJ4v2AR3r3Vy_BTeHrHwy2JEJxhp-MVnZA,59872
|
@@ -36,7 +36,7 @@ seleniumbase/console_scripts/sb_print.py,sha256=tNy-bMDgwHJO3bZxMpmo9weSE8uhbH0C
|
|
36
36
|
seleniumbase/console_scripts/sb_recorder.py,sha256=DH-n2fN7N9qyHMl7wjtn8MiliBgfw-1kwgmfg1GUuhk,10772
|
37
37
|
seleniumbase/core/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
38
38
|
seleniumbase/core/application_manager.py,sha256=e_0sjtI8cjY5BNyZj1QBR0j6_oCScxGmSXYEpcYwuZE,576
|
39
|
-
seleniumbase/core/browser_launcher.py,sha256=
|
39
|
+
seleniumbase/core/browser_launcher.py,sha256=blf1TjsMyU6Lk_0jxDM_MLX5tk4XCToGxzwXWI333Po,247842
|
40
40
|
seleniumbase/core/capabilities_parser.py,sha256=meIS2uHapTCq2ldfNAToC7r0cKmZDRXuYNKExM1GHDY,6038
|
41
41
|
seleniumbase/core/colored_traceback.py,sha256=DrRWfg7XEnKcgY59Xj7Jdk09H-XqHYBSUpB-DiZt6iY,2020
|
42
42
|
seleniumbase/core/create_db_tables.sql,sha256=VWPtrdiW_HQ6yETHjqTu-VIrTwvd8I8o1NfBeaVSHpU,972
|
@@ -50,7 +50,7 @@ seleniumbase/core/proxy_helper.py,sha256=pZ1NboNfziHU3vWZLOZLX-qkfM3oKSnpc3omQf9
|
|
50
50
|
seleniumbase/core/recorder_helper.py,sha256=OBqNiCC_11ctpsD72KV4YUaKovmSpvs14HP1gwFesBA,25190
|
51
51
|
seleniumbase/core/report_helper.py,sha256=AIl6Qava2yW1uSzbLpJBlPlYDz0KE-rVhogh8hsGWBo,12201
|
52
52
|
seleniumbase/core/s3_manager.py,sha256=z_4qx2jI_gtK5r3niGXgEOBpfMUicUCOciowai50MP4,3529
|
53
|
-
seleniumbase/core/sb_cdp.py,sha256=
|
53
|
+
seleniumbase/core/sb_cdp.py,sha256=5HttSd6ZKAJK_7IPbKDYuc7gzybIc5u6zmKSqyHIM6s,100461
|
54
54
|
seleniumbase/core/sb_driver.py,sha256=yUdS9_9OXTVaWzp1qY7msvnsvCK8X3FIcxMixb0BuBE,13827
|
55
55
|
seleniumbase/core/session_helper.py,sha256=s9zD3PVZEWVzG2h81cCUskbNWLfdjC_LwwQjKptHCak,558
|
56
56
|
seleniumbase/core/settings_parser.py,sha256=gqVohHVlE_5L5Cqe2L24uYrRzvoK-saX8E_Df7_-_3I,7609
|
@@ -137,9 +137,9 @@ seleniumbase/utilities/selenium_grid/start-grid-hub.bat,sha256=Ftq-GrAKRYH2ssDPr
|
|
137
137
|
seleniumbase/utilities/selenium_grid/start-grid-hub.sh,sha256=KADv0RUHONLL2_I443QFK8PryBpDmKn5Gy0s4o0vDSM,106
|
138
138
|
seleniumbase/utilities/selenium_ide/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
139
139
|
seleniumbase/utilities/selenium_ide/convert_ide.py,sha256=pZFnqEJQEKZPyNFjkLD29s2HPQgCrWW9XJWpCPhWOoM,31691
|
140
|
-
seleniumbase-4.41.
|
141
|
-
seleniumbase-4.41.
|
142
|
-
seleniumbase-4.41.
|
143
|
-
seleniumbase-4.41.
|
144
|
-
seleniumbase-4.41.
|
145
|
-
seleniumbase-4.41.
|
140
|
+
seleniumbase-4.41.3.dist-info/licenses/LICENSE,sha256=BRblZsX7HyPUjQmYTiyWr_e9tzWvmR3R4SFclM2R3W0,1085
|
141
|
+
seleniumbase-4.41.3.dist-info/METADATA,sha256=VcWEKRpNA3DE-q2DczW6NA4TNtnJo42UB-JZHYBCCYc,87563
|
142
|
+
seleniumbase-4.41.3.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
143
|
+
seleniumbase-4.41.3.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
|
144
|
+
seleniumbase-4.41.3.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
|
145
|
+
seleniumbase-4.41.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|