seleniumbase 4.35.6__py3-none-any.whl → 4.35.7__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.
@@ -1,2 +1,2 @@
1
1
  # seleniumbase package
2
- __version__ = "4.35.6"
2
+ __version__ = "4.35.7"
@@ -662,6 +662,7 @@ def uc_open_with_cdp_mode(driver, url=None):
662
662
  cdp.press_keys = CDPM.press_keys
663
663
  cdp.type = CDPM.type
664
664
  cdp.set_value = CDPM.set_value
665
+ cdp.submit = CDPM.submit
665
666
  cdp.evaluate = CDPM.evaluate
666
667
  cdp.js_dumps = CDPM.js_dumps
667
668
  cdp.maximize = CDPM.maximize
@@ -670,6 +671,8 @@ def uc_open_with_cdp_mode(driver, url=None):
670
671
  cdp.set_window_rect = CDPM.set_window_rect
671
672
  cdp.reset_window_size = CDPM.reset_window_size
672
673
  cdp.set_locale = CDPM.set_locale
674
+ cdp.set_local_storage_item = CDPM.set_local_storage_item
675
+ cdp.set_session_storage_item = CDPM.set_session_storage_item
673
676
  cdp.set_attributes = CDPM.set_attributes
674
677
  cdp.gui_press_key = CDPM.gui_press_key
675
678
  cdp.gui_press_keys = CDPM.gui_press_keys
@@ -705,6 +708,8 @@ def uc_open_with_cdp_mode(driver, url=None):
705
708
  cdp.get_user_agent = CDPM.get_user_agent
706
709
  cdp.get_cookie_string = CDPM.get_cookie_string
707
710
  cdp.get_locale_code = CDPM.get_locale_code
711
+ cdp.get_local_storage_item = CDPM.get_local_storage_item
712
+ cdp.get_session_storage_item = CDPM.get_session_storage_item
708
713
  cdp.get_text = CDPM.get_text
709
714
  cdp.get_title = CDPM.get_title
710
715
  cdp.get_page_title = CDPM.get_title
@@ -955,6 +955,20 @@ class CDPMethods():
955
955
  self.__slow_mode_pause_if_set()
956
956
  self.loop.run_until_complete(self.page.sleep(0.025))
957
957
 
958
+ def submit(self, selector):
959
+ submit_script = (
960
+ """elm = document.querySelector('%s');
961
+ const event = new KeyboardEvent("keydown", {
962
+ key: "Enter",
963
+ keyCode: 13,
964
+ code: "Enter",
965
+ which: 13,
966
+ bubbles: true
967
+ });
968
+ elm.dispatchEvent(event);""" % selector
969
+ )
970
+ self.loop.run_until_complete(self.page.evaluate(submit_script))
971
+
958
972
  def evaluate(self, expression):
959
973
  """Run a JavaScript expression and return the result."""
960
974
  expression = expression.strip()
@@ -1115,6 +1129,16 @@ class CDPMethods():
1115
1129
  self.page.evaluate("navigator.language || navigator.languages[0]")
1116
1130
  )
1117
1131
 
1132
+ def get_local_storage_item(self, key):
1133
+ js_code = """localStorage.getItem('%s');""" % key
1134
+ with suppress(Exception):
1135
+ return self.loop.run_until_complete(self.page.evaluate(js_code))
1136
+
1137
+ def get_session_storage_item(self, key):
1138
+ js_code = """sessionStorage.getItem('%s');""" % key
1139
+ with suppress(Exception):
1140
+ return self.loop.run_until_complete(self.page.evaluate(js_code))
1141
+
1118
1142
  def get_screen_rect(self):
1119
1143
  coordinates = self.loop.run_until_complete(
1120
1144
  self.page.js_dumps("window.screen")
@@ -1302,6 +1326,16 @@ class CDPMethods():
1302
1326
  """(Settings will take effect on the next page load)"""
1303
1327
  self.loop.run_until_complete(self.page.set_locale(locale))
1304
1328
 
1329
+ def set_local_storage_item(self, key, value):
1330
+ js_code = """localStorage.setItem('%s','%s');""" % (key, value)
1331
+ with suppress(Exception):
1332
+ self.loop.run_until_complete(self.page.evaluate(js_code))
1333
+
1334
+ def set_session_storage_item(self, key, value):
1335
+ js_code = """sessionStorage.setItem('%s','%s');""" % (key, value)
1336
+ with suppress(Exception):
1337
+ self.loop.run_until_complete(self.page.evaluate(js_code))
1338
+
1305
1339
  def set_attributes(self, selector, attribute, value):
1306
1340
  """This method uses JavaScript to set/update a common attribute.
1307
1341
  All matching selectors from querySelectorAll() are used.
@@ -1164,6 +1164,9 @@ class BaseCase(unittest.TestCase):
1164
1164
  """Alternative to self.driver.find_element_by_*(SELECTOR).submit()"""
1165
1165
  self.__check_scope()
1166
1166
  selector, by = self.__recalculate_selector(selector, by)
1167
+ if self.__is_cdp_swap_needed():
1168
+ self.cdp.submit(selector)
1169
+ return
1167
1170
  element = self.wait_for_element_clickable(
1168
1171
  selector, by=by, timeout=settings.SMALL_TIMEOUT
1169
1172
  )
@@ -8800,6 +8803,9 @@ class BaseCase(unittest.TestCase):
8800
8803
  self.__check_scope()
8801
8804
  if not self.__is_valid_storage_url():
8802
8805
  raise WebDriverException("Local Storage is not available here!")
8806
+ if self.__is_cdp_swap_needed():
8807
+ self.cdp.set_local_storage_item(key, value)
8808
+ return
8803
8809
  self.execute_script(
8804
8810
  "window.localStorage.setItem('{}', '{}');".format(key, value)
8805
8811
  )
@@ -8808,6 +8814,8 @@ class BaseCase(unittest.TestCase):
8808
8814
  self.__check_scope()
8809
8815
  if not self.__is_valid_storage_url():
8810
8816
  raise WebDriverException("Local Storage is not available here!")
8817
+ if self.__is_cdp_swap_needed():
8818
+ return self.cdp.get_local_storage_item(key)
8811
8819
  return self.execute_script(
8812
8820
  "return window.localStorage.getItem('{}');".format(key)
8813
8821
  )
@@ -8859,6 +8867,9 @@ class BaseCase(unittest.TestCase):
8859
8867
  self.__check_scope()
8860
8868
  if not self.__is_valid_storage_url():
8861
8869
  raise WebDriverException("Session Storage is not available here!")
8870
+ if self.__is_cdp_swap_needed():
8871
+ self.cdp.set_session_storage_item(key, value)
8872
+ return
8862
8873
  self.execute_script(
8863
8874
  "window.sessionStorage.setItem('{}', '{}');".format(key, value)
8864
8875
  )
@@ -8867,6 +8878,8 @@ class BaseCase(unittest.TestCase):
8867
8878
  self.__check_scope()
8868
8879
  if not self.__is_valid_storage_url():
8869
8880
  raise WebDriverException("Session Storage is not available here!")
8881
+ if self.__is_cdp_swap_needed():
8882
+ return self.cdp.get_session_storage_item(key)
8870
8883
  return self.execute_script(
8871
8884
  "return window.sessionStorage.getItem('{}');".format(key)
8872
8885
  )
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.2
2
2
  Name: seleniumbase
3
- Version: 4.35.6
3
+ Version: 4.35.7
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
@@ -62,7 +62,7 @@ License-File: LICENSE
62
62
  Requires-Dist: pip>=25.0.1
63
63
  Requires-Dist: packaging>=24.2
64
64
  Requires-Dist: setuptools~=70.2; python_version < "3.10"
65
- Requires-Dist: setuptools>=75.8.2; python_version >= "3.10"
65
+ Requires-Dist: setuptools>=76.0.0; python_version >= "3.10"
66
66
  Requires-Dist: wheel>=0.45.1
67
67
  Requires-Dist: attrs>=25.1.0
68
68
  Requires-Dist: certifi>=2025.1.31
@@ -72,7 +72,7 @@ Requires-Dist: websockets>=15.0.1; python_version >= "3.9"
72
72
  Requires-Dist: filelock~=3.16.1; python_version < "3.9"
73
73
  Requires-Dist: filelock>=3.17.0; python_version >= "3.9"
74
74
  Requires-Dist: fasteners>=0.19
75
- Requires-Dist: mycdp>=1.1.0
75
+ Requires-Dist: mycdp>=1.1.1
76
76
  Requires-Dist: pynose>=1.5.4
77
77
  Requires-Dist: platformdirs>=4.3.6
78
78
  Requires-Dist: typing-extensions>=4.12.2
@@ -105,7 +105,8 @@ Requires-Dist: wsproto==1.2.0
105
105
  Requires-Dist: websocket-client==1.8.0
106
106
  Requires-Dist: selenium==4.27.1; python_version < "3.9"
107
107
  Requires-Dist: selenium==4.29.0; python_version >= "3.9"
108
- Requires-Dist: cssselect==1.2.0
108
+ Requires-Dist: cssselect==1.2.0; python_version < "3.9"
109
+ Requires-Dist: cssselect==1.3.0; python_version >= "3.9"
109
110
  Requires-Dist: sortedcontainers==2.4.0
110
111
  Requires-Dist: execnet==2.1.1
111
112
  Requires-Dist: iniconfig==2.0.0
@@ -205,7 +206,6 @@ Dynamic: summary
205
206
 
206
207
  <p align="center"><a href="https://github.com/seleniumbase/SeleniumBase/"><img src="https://seleniumbase.github.io/cdn/img/super_logo_sb3.png" alt="SeleniumBase" title="SeleniumBase" width="350" /></a></p>
207
208
 
208
-
209
209
  <p align="center" class="hero__title"><b>All-in-one Browser Automation Framework:<br />Web Crawling / Testing / Scraping / Stealth</b></p>
210
210
 
211
211
  <p align="center"><a href="https://pypi.python.org/pypi/seleniumbase" target="_blank"><img src="https://img.shields.io/pypi/v/seleniumbase.svg?color=3399EE" alt="PyPI version" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/releases" target="_blank"><img src="https://img.shields.io/github/v/release/seleniumbase/SeleniumBase.svg?color=22AAEE" alt="GitHub version" /></a> <a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/actions" target="_blank"><img src="https://github.com/seleniumbase/SeleniumBase/workflows/CI%20build/badge.svg" alt="SeleniumBase GitHub Actions" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/badge/join-discord-infomational" alt="Join the SeleniumBase chat on Discord"/></a></p>
@@ -248,7 +248,9 @@ Dynamic: summary
248
248
  <br />
249
249
  </p>
250
250
 
251
- <p>SeleniumBase is the professional toolkit for web automation activities. Built for testing websites, bypassing CAPTCHAs, enhancing productivity, completing tasks, and scaling your business.</p>
251
+ <p align="center"><a href="https://trendshift.io/repositories/12493" target="_blank"><img src="https://trendshift.io/api/badge/repositories/12493" alt="seleniumbase%2FSeleniumBase | Trendshift" style="width: 250px; height: 55px;" width="250" height="55"/></a></p>
252
+
253
+ <p>SeleniumBase is the professional toolkit for web automation. Built for testing websites, bypassing CAPTCHAs, completing tasks, and scaling your business.</p>
252
254
 
253
255
  --------
254
256
 
@@ -275,7 +277,7 @@ with SB(test=True, uc=True) as sb:
275
277
 
276
278
  > `python raw_google.py`
277
279
 
278
- <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py"><img src="https://seleniumbase.github.io/cdn/gif/google_search.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="420" /></a>
280
+ <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/examples/raw_google.py"><img src="https://seleniumbase.github.io/cdn/gif/google_search.gif" alt="SeleniumBase Test" title="SeleniumBase Test" width="480" /></a>
279
281
 
280
282
  --------
281
283
 
@@ -1587,5 +1589,5 @@ pytest --reruns=1 --reruns-delay=1
1587
1589
  <div><a href="https://seleniumbase.io"><img src="https://img.shields.io/badge/docs-seleniumbase.io-11BBAA.svg" alt="SeleniumBase Docs" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-22BBCC.svg" title="SeleniumBase" /></a></div>
1588
1590
  <div><a href="https://github.com/seleniumbase/SeleniumBase"><img src="https://img.shields.io/badge/tested%20with-SeleniumBase-04C38E.svg" alt="Tested with SeleniumBase" /></a> <a href="https://github.com/seleniumbase/SeleniumBase/stargazers"><img src="https://img.shields.io/github/stars/seleniumbase/seleniumbase.svg?color=19A57B" title="Stargazers" /></a></div>
1589
1591
  <div><a href="https://hellogithub.com/repository/c6be2d0f1969448697683d11a4ff915e" target="_blank"><img src="https://abroad.hellogithub.com/v1/widgets/recommend.svg?rid=c6be2d0f1969448697683d11a4ff915e&claim_uid=xcrm4p9j3d6JCO5&theme=small" alt="Featured|HelloGitHub" /></a> <a href="https://discord.gg/EdhQTn3EyE" target="_blank"><img src="https://img.shields.io/badge/join-discord-infomational" alt="Join the SeleniumBase chat on Discord"/></a> <a href="https://gitter.im/seleniumbase/SeleniumBase" target="_blank"><img src="https://img.shields.io/gitter/room/seleniumbase/SeleniumBase.svg" alt="Gitter chat"/></a></div>
1590
- <div><a href="https://pepy.tech/project/seleniumbase" target="_blank"><img src="https://static.pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a> <img src="https://views.whatilearened.today/views/github/seleniumbase/SeleniumBase.svg" width="98px" height="20px" alt="Views" /></div>
1592
+ <div><a href="https://pepy.tech/projects/seleniumbase?timeRange=threeMonths&category=version&includeCIDownloads=true&granularity=daily&viewType=line&versions=*" target="_blank"><img src="https://static.pepy.tech/badge/seleniumbase" alt="SeleniumBase PyPI downloads" /></a> <img src="https://views.whatilearened.today/views/github/seleniumbase/SeleniumBase.svg" width="98px" height="20px" alt="Views" /></div>
1591
1593
  <div align="left"></div>
@@ -3,7 +3,7 @@ sbase/__main__.py,sha256=G0bVB1-DM4PGwQ1KyOupaWCs4ePbChZNNWuX2htim5U,647
3
3
  sbase/steps.py,sha256=_WvAjydKqZfTdnZW9LPKkRty-g-lfdUPmLqnZj6ulcs,43013
4
4
  seleniumbase/__init__.py,sha256=JFEY9P5QJqsa1M6ghzLMH2eIPQyh85iglCaQwg8Y8z4,2498
5
5
  seleniumbase/__main__.py,sha256=dn1p6dgCchmcH1zzTzzQvFwwdQQqnTGH6ULV9m4hv24,654
6
- seleniumbase/__version__.py,sha256=Qk_EEqY0cnPtJGo10493AM6wgrednIw-0Fi8Wg6TZTY,46
6
+ seleniumbase/__version__.py,sha256=2g_cMybJdzQUUg-Rv9MQSXKu_EOLpRJPRUOLws8LJ54,46
7
7
  seleniumbase/behave/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
8
  seleniumbase/behave/behave_helper.py,sha256=elkl8P9eLulRAioLstE9baYNM9N_PHBmAOcajX-pH_Y,24198
9
9
  seleniumbase/behave/behave_sb.py,sha256=qQF85LoohJBfrPK5ZcPi50v-pWtOrC9qcN1B3Ki_3tY,59401
@@ -36,7 +36,7 @@ seleniumbase/console_scripts/sb_print.py,sha256=tNy-bMDgwHJO3bZxMpmo9weSE8uhbH0C
36
36
  seleniumbase/console_scripts/sb_recorder.py,sha256=fnHb5-kh11Hit-E9Ha-e4QXzqLcZvtij6mb5qNd4B1Q,11032
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=jI_VTZIK_kDMRi_xromXvTjw1MYaJhFABda-r8ezLPc,238683
39
+ seleniumbase/core/browser_launcher.py,sha256=xOHybb7tdhQRS4-2FNyT6cdnbdMczKQS7PBvgOu72ws,238964
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=4VkpMwavz0fx8wcOqJ_jyBT0HIXwcxmAcpd1gjJ
50
50
  seleniumbase/core/recorder_helper.py,sha256=fNGjbapXmEsht54x1o6Igk198QdnPxDDnjUOzQxNhNQ,25055
51
51
  seleniumbase/core/report_helper.py,sha256=AIl6Qava2yW1uSzbLpJBlPlYDz0KE-rVhogh8hsGWBo,12201
52
52
  seleniumbase/core/s3_manager.py,sha256=bkeI8I4y19ebWuQG1oEZV5qJbotC6eN8vin31OCNWJk,3521
53
- seleniumbase/core/sb_cdp.py,sha256=xKhJowUxlDK_2jjM5DGGj2UMa-cBU28xihrScgtz7ZE,83866
53
+ seleniumbase/core/sb_cdp.py,sha256=qfbPDXOXmOaMaCu5QXqOvTPXJjnsWmvndBoOUTqC0vY,85218
54
54
  seleniumbase/core/sb_driver.py,sha256=yvTDRblBzG6bDX7XcLiAA6QcBelSJj_HHL_04lcfeeE,13760
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
@@ -65,7 +65,7 @@ seleniumbase/extensions/disable_csp.zip,sha256=5RvomXnm2PdivUVcxTV6jfvD8WhTEsQYH
65
65
  seleniumbase/extensions/recorder.zip,sha256=OOyzF-Ize2cSRu1CqhzSAq5vusI9hqLLd2OIApUHesI,11918
66
66
  seleniumbase/extensions/sbase_ext.zip,sha256=3s1N8zrVaMz8RQEOIoBzC3KDjtmHwVZRvVsX25Odr_s,8175
67
67
  seleniumbase/fixtures/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
- seleniumbase/fixtures/base_case.py,sha256=aIOcu9dSugOubPl93nrNrG0pE1ljPs15GtAXb9Lvmm0,723904
68
+ seleniumbase/fixtures/base_case.py,sha256=wHlPIN7B84mjXHd_um_0AFlnwQf8c7DCeJ7uY-rpLJY,724427
69
69
  seleniumbase/fixtures/constants.py,sha256=WMrItuNyKq3XVJ64NluLIRc4gJCxDw8K8qXED0b9S2w,13752
70
70
  seleniumbase/fixtures/css_to_xpath.py,sha256=9ouDB1xl4MJ2os6JOgTIAyHKOQfuxtxvXC3O5hSnEKA,1954
71
71
  seleniumbase/fixtures/errors.py,sha256=KyxuEVx_e3MPhVrJfNIa_3ltMpbCFxfy_jxK8RFNTns,555
@@ -135,9 +135,9 @@ seleniumbase/utilities/selenium_grid/start-grid-hub.bat,sha256=Ftq-GrAKRYH2ssDPr
135
135
  seleniumbase/utilities/selenium_grid/start-grid-hub.sh,sha256=KADv0RUHONLL2_I443QFK8PryBpDmKn5Gy0s4o0vDSM,106
136
136
  seleniumbase/utilities/selenium_ide/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
137
137
  seleniumbase/utilities/selenium_ide/convert_ide.py,sha256=pZFnqEJQEKZPyNFjkLD29s2HPQgCrWW9XJWpCPhWOoM,31691
138
- seleniumbase-4.35.6.dist-info/LICENSE,sha256=BRblZsX7HyPUjQmYTiyWr_e9tzWvmR3R4SFclM2R3W0,1085
139
- seleniumbase-4.35.6.dist-info/METADATA,sha256=we_9vLwuqFaRKPLMxpz9Fq2YSRWK7z5NVZtnTa6wqYY,86527
140
- seleniumbase-4.35.6.dist-info/WHEEL,sha256=jB7zZ3N9hIM9adW7qlTAyycLYW9npaWKLRzaoVcLKcM,91
141
- seleniumbase-4.35.6.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
142
- seleniumbase-4.35.6.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
143
- seleniumbase-4.35.6.dist-info/RECORD,,
138
+ seleniumbase-4.35.7.dist-info/LICENSE,sha256=BRblZsX7HyPUjQmYTiyWr_e9tzWvmR3R4SFclM2R3W0,1085
139
+ seleniumbase-4.35.7.dist-info/METADATA,sha256=-S8BkakysShn-OesLThYaKJjEvUNOddToIQ8dC07GrQ,86944
140
+ seleniumbase-4.35.7.dist-info/WHEEL,sha256=52BFRY2Up02UkjOa29eZOS2VxUrpPORXg1pkohGGUS8,91
141
+ seleniumbase-4.35.7.dist-info/entry_points.txt,sha256=CNrh2EKNaHYEhO6pP1RJyVLB99LkDDYX7TnUK8xfjqk,623
142
+ seleniumbase-4.35.7.dist-info/top_level.txt,sha256=4N97aBOQ8ETCnDnokBsWb07lJfTaq3C1ZzYRxvLMxqU,19
143
+ seleniumbase-4.35.7.dist-info/RECORD,,
@@ -1,5 +1,5 @@
1
1
  Wheel-Version: 1.0
2
- Generator: setuptools (75.8.2)
2
+ Generator: setuptools (76.0.0)
3
3
  Root-Is-Purelib: true
4
4
  Tag: py3-none-any
5
5