seleniumbase 4.54.1__tar.gz → 4.54.2__tar.gz

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.
Files changed (164) hide show
  1. {seleniumbase-4.54.1/seleniumbase.egg-info → seleniumbase-4.54.2}/PKG-INFO +2 -1
  2. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/README.md +1 -0
  3. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/mcp_servers/server.py +80 -76
  4. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/__version__.py +1 -1
  5. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/sb_cdp.py +17 -7
  6. {seleniumbase-4.54.1 → seleniumbase-4.54.2/seleniumbase.egg-info}/PKG-INFO +2 -1
  7. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/.gitignore +0 -0
  8. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/LICENSE +0 -0
  9. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/MANIFEST.in +0 -0
  10. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/install.sh +0 -0
  11. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/mcp_servers/__init__.py +0 -0
  12. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/pyproject.toml +0 -0
  13. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/pytest.ini +0 -0
  14. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/requirements.txt +0 -0
  15. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/sbase/__init__.py +0 -0
  16. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/sbase/__main__.py +0 -0
  17. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/sbase/steps.py +0 -0
  18. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/__init__.py +0 -0
  19. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/__main__.py +0 -0
  20. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/behave/__init__.py +0 -0
  21. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/behave/behave_helper.py +0 -0
  22. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/behave/behave_sb.py +0 -0
  23. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/behave/steps.py +0 -0
  24. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/common/__init__.py +0 -0
  25. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/common/decorators.py +0 -0
  26. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/common/encryption.py +0 -0
  27. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/common/exceptions.py +0 -0
  28. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/common/obfuscate.py +0 -0
  29. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/common/unobfuscate.py +0 -0
  30. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/config/__init__.py +0 -0
  31. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/config/ad_block_list.py +0 -0
  32. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/config/proxy_list.py +0 -0
  33. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/config/settings.py +0 -0
  34. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/__init__.py +0 -0
  35. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/logo_helper.py +0 -0
  36. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/rich_helper.py +0 -0
  37. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/run.py +0 -0
  38. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_behave_gui.py +0 -0
  39. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_caseplans.py +0 -0
  40. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_commander.py +0 -0
  41. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_install.py +0 -0
  42. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_mkchart.py +0 -0
  43. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_mkdir.py +0 -0
  44. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_mkfile.py +0 -0
  45. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_mkpres.py +0 -0
  46. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_mkrec.py +0 -0
  47. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_objectify.py +0 -0
  48. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_print.py +0 -0
  49. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/console_scripts/sb_recorder.py +0 -0
  50. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/__init__.py +0 -0
  51. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/application_manager.py +0 -0
  52. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/browser_launcher.py +0 -0
  53. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/capabilities_parser.py +0 -0
  54. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/colored_traceback.py +0 -0
  55. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/create_db_tables.sql +0 -0
  56. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/detect_b_ver.py +0 -0
  57. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/download_helper.py +0 -0
  58. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/encoded_images.py +0 -0
  59. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/jqc_helper.py +0 -0
  60. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/log_helper.py +0 -0
  61. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/mysql.py +0 -0
  62. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/nest_asyncio.py +0 -0
  63. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/proxy_helper.py +0 -0
  64. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/recorder_helper.py +0 -0
  65. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/report_helper.py +0 -0
  66. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/s3_manager.py +0 -0
  67. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/sb_driver.py +0 -0
  68. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/session_helper.py +0 -0
  69. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/settings_parser.py +0 -0
  70. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/style_sheet.py +0 -0
  71. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/testcase_manager.py +0 -0
  72. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/tour_helper.py +0 -0
  73. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/core/visual_helper.py +0 -0
  74. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/drivers/__init__.py +0 -0
  75. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/drivers/brave_drivers/__init__.py +0 -0
  76. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/drivers/cft_drivers/__init__.py +0 -0
  77. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/drivers/chromium_drivers/__init__.py +0 -0
  78. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/drivers/chs_drivers/__init__.py +0 -0
  79. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/drivers/comet_drivers/__init__.py +0 -0
  80. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/drivers/opera_drivers/__init__.py +0 -0
  81. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/extensions/__init__.py +0 -0
  82. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/extensions/ad_block.zip +0 -0
  83. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/extensions/disable_csp.zip +0 -0
  84. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/extensions/recorder.zip +0 -0
  85. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/extensions/sbase_ext.zip +0 -0
  86. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/__init__.py +0 -0
  87. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/base_case.py +0 -0
  88. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/constants.py +0 -0
  89. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/css_to_xpath.py +0 -0
  90. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/errors.py +0 -0
  91. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/js_utils.py +0 -0
  92. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/page_actions.py +0 -0
  93. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/page_utils.py +0 -0
  94. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/shared_utils.py +0 -0
  95. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/unittest_helper.py +0 -0
  96. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/words.py +0 -0
  97. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/fixtures/xpath_to_css.py +0 -0
  98. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/js_code/__init__.py +0 -0
  99. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/js_code/active_css_js.py +0 -0
  100. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/js_code/live_js.py +0 -0
  101. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/js_code/recorder_js.py +0 -0
  102. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/masterqa/__init__.py +0 -0
  103. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/masterqa/master_qa.py +0 -0
  104. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/__init__.py +0 -0
  105. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/base_plugin.py +0 -0
  106. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/basic_test_info.py +0 -0
  107. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/db_reporting_plugin.py +0 -0
  108. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/driver_manager.py +0 -0
  109. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/page_source.py +0 -0
  110. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/pytest_plugin.py +0 -0
  111. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/s3_logging_plugin.py +0 -0
  112. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/sb_manager.py +0 -0
  113. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/screen_shots.py +0 -0
  114. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/plugins/selenium_plugin.py +0 -0
  115. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/resources/__init__.py +0 -0
  116. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/__init__.py +0 -0
  117. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/chinese.py +0 -0
  118. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/dutch.py +0 -0
  119. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/french.py +0 -0
  120. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/italian.py +0 -0
  121. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/japanese.py +0 -0
  122. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/korean.py +0 -0
  123. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/master_dict.py +0 -0
  124. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/portuguese.py +0 -0
  125. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/russian.py +0 -0
  126. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/spanish.py +0 -0
  127. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/translate/translator.py +0 -0
  128. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/__init__.py +0 -0
  129. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp.py +0 -0
  130. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp_driver/__init__.py +0 -0
  131. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp_driver/_contradict.py +0 -0
  132. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp_driver/browser.py +0 -0
  133. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp_driver/cdp_util.py +0 -0
  134. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp_driver/config.py +0 -0
  135. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp_driver/connection.py +0 -0
  136. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp_driver/element.py +0 -0
  137. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/cdp_driver/tab.py +0 -0
  138. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/dprocess.py +0 -0
  139. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/options.py +0 -0
  140. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/patcher.py +0 -0
  141. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/reactor.py +0 -0
  142. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/undetected/webelement.py +0 -0
  143. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/__init__.py +0 -0
  144. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/__init__.py +0 -0
  145. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/download_selenium_server.py +0 -0
  146. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/font_color +0 -0
  147. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/grid-hub +0 -0
  148. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/grid-node +0 -0
  149. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/grid_hub.py +0 -0
  150. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/grid_node.py +0 -0
  151. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/register-grid-node.bat +0 -0
  152. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/register-grid-node.sh +0 -0
  153. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/start-grid-hub.bat +0 -0
  154. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_grid/start-grid-hub.sh +0 -0
  155. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_ide/__init__.py +0 -0
  156. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase/utilities/selenium_ide/convert_ide.py +0 -0
  157. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase.egg-info/SOURCES.txt +0 -0
  158. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase.egg-info/dependency_links.txt +0 -0
  159. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase.egg-info/entry_points.txt +0 -0
  160. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase.egg-info/requires.txt +0 -0
  161. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/seleniumbase.egg-info/top_level.txt +0 -0
  162. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/setup.cfg +0 -0
  163. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/setup.py +0 -0
  164. {seleniumbase-4.54.1 → seleniumbase-4.54.2}/virtualenv_install.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seleniumbase
3
- Version: 4.54.1
3
+ Version: 4.54.2
4
4
  Summary: SeleniumBase is a framework for web crawling, scraping, and testing. Supports pytest. CDP Mode adds stealth. Includes many tools.
5
5
  Home-page: https://github.com/seleniumbase/SeleniumBase
6
6
  Author: Michael Mintz
@@ -171,6 +171,7 @@ Dynamic: requires-python
171
171
  Dynamic: summary
172
172
 
173
173
  <!-- SeleniumBase Docs -->
174
+ <!-- mcp-name: io.github.seleniumbase/seleniumbase -->
174
175
 
175
176
  <meta property="og:site_name" content="SeleniumBase">
176
177
  <meta property="og:title" content="SeleniumBase: Stealthy Chromium Automation with Python; and E2E Testing." />
@@ -1,4 +1,5 @@
1
1
  <!-- SeleniumBase Docs -->
2
+ <!-- mcp-name: io.github.seleniumbase/seleniumbase -->
2
3
 
3
4
  <meta property="og:site_name" content="SeleniumBase">
4
5
  <meta property="og:title" content="SeleniumBase: Stealthy Chromium Automation with Python; and E2E Testing." />
@@ -446,10 +446,16 @@ def find_elements(
446
446
  dictionaries. It does not return live SeleniumBase element objects.
447
447
 
448
448
  Args:
449
- selector: A SeleniumBase-supported selector, typically CSS or XPath.
449
+ selector: A CSS selector, or an XPath selector that SeleniumBase can
450
+ convert to CSS. In sb.find_elements, SeleniumBase automatically
451
+ attempts to convert XPath to CSS. Some XPath expressions, such
452
+ as those using `contains(...)`, cannot be converted to CSS and
453
+ therefore aren't supported by this tool.
450
454
 
451
455
  timeout: Maximum number of seconds to wait for at least one matching
452
- element to appear.
456
+ element to appear. If the selector is an XPath selector that
457
+ cannot be converted into a valid CSS selector, then the wait
458
+ might be less than the timeout.
453
459
 
454
460
  include_html: If True, include each matching element's outer HTML.
455
461
  If False, return only tag name and text.
@@ -459,7 +465,8 @@ def find_elements(
459
465
  - count: Number of matching elements found.
460
466
  - matches: A list of element dictionaries containing tag_name and
461
467
  text, plus html when include_html=True.
462
- If there's an error, returns a string with error details.
468
+ If there's an error during search, then "error" is added into the
469
+ returned dictionary with error details.
463
470
 
464
471
  Tool selection:
465
472
  - Need structured information about matching elements ->
@@ -470,77 +477,63 @@ def find_elements(
470
477
  - Need to know whether an element is present/visible ->
471
478
  use check_condition.
472
479
 
473
- Note:
480
+ Notes:
474
481
  Element handles cannot be persisted across MCP calls. If you find
475
482
  elements and then need to act on one, resolve it again with the
476
483
  appropriate interaction tool.
484
+
485
+ For uncaught errors, @handle_sb_errors returns strings.
477
486
  """
478
487
  sb = _get_sb()
479
- elements = sb.find_elements(selector, timeout=timeout)
480
-
481
- if include_html:
488
+ try:
489
+ elements = sb.find_elements(selector, timeout=timeout)
490
+ except Exception as e:
482
491
  return {
483
- "count": len(elements),
484
- "matches": [
485
- {
486
- "tag_name": element.tag_name,
487
- "text": element.text,
488
- "html": element.get_html(),
489
- }
490
- for element in elements
491
- ],
492
+ "count": 0,
493
+ "matches": [],
494
+ "error": str(e),
492
495
  }
493
496
 
497
+ matches = []
498
+ for element in elements:
499
+ match = {
500
+ "tag_name": element.tag_name,
501
+ "text": element.text,
502
+ }
503
+ if include_html:
504
+ match["html"] = element.get_html()
505
+ matches.append(match)
506
+
494
507
  return {
495
- "count": len(elements),
496
- "matches": [
497
- {
498
- "tag_name": element.tag_name,
499
- "text": element.text,
500
- }
501
- for element in elements
502
- ],
508
+ "count": len(matches),
509
+ "matches": matches,
503
510
  }
504
511
 
505
512
 
506
513
  @mcp.tool()
507
514
  @handle_sb_errors
508
515
  def get_content(
509
- selector: str | None = None,
516
+ selector: str = "body",
510
517
  output_format: Literal["text", "html", "urls"] = "text",
511
- include_shadow_dom: bool = True,
518
+ timeout: float = 5,
512
519
  ) -> str | list[str]:
513
- """Read visible text, HTML, or discovered URLs from the current page.
520
+ """Read visible text, HTML, or discovered URLs from the selected element.
514
521
 
515
- Use this tool when you need actual page content or URL information rather
516
- than page metadata.
522
+ Use this tool when you need to get actual page content or URL information
523
+ rather than page metadata.
517
524
 
518
525
  Args:
519
- selector: Optional CSS selector or SeleniumBase text-matching selector
520
- identifying the element whose content should be read. For
521
- output_format="text" or "html", the selector scopes the returned
522
- content to that element. For output_format="urls", the selector
523
- scopes URL discovery to URLs within that element. When omitted,
524
- the operation applies to the whole page.
526
+ selector: CSS selector or SeleniumBase-supported XPath selector.
525
527
 
526
528
  output_format:
527
- - "text": Return visible text from the page or selected element.
528
- - "html": Return HTML from the page or selected element.
529
- - "urls": Return URLs discovered by SeleniumBase from the page
530
- or selected element. URLs associated with elements such as
531
- anchors, links, images, scripts, and metadata may be included.
532
- SeleniumBase returns full URLs with their URL protocol prefixes.
529
+ - "text": Return visible text from the selected element.
530
+ - "html": Return HTML from the selected element.
531
+ - "urls": Return URLs discovered by SeleniumBase within the
532
+ selected element. Returned URLs are normalized to full URLs
533
+ with their protocol prefixes.
533
534
 
534
- include_shadow_dom: When output_format="html" and selector is omitted,
535
- include any shadow-root HTML present in the page. This option has
536
- no effect for "text" or "urls", or when a selector is specified.
537
535
 
538
- Returns:
539
- For output_format="text", a string containing visible text.
540
- For output_format="html", a string containing HTML.
541
- For output_format="urls", a list of URL strings. This is useful for
542
- crawling, link discovery, resource inspection, and finding candidate
543
- URLs before navigating to them.
536
+ timeout: Maximum seconds to wait for the target element. Default: 5.
544
537
 
545
538
  Tool selection:
546
539
  - Need URL, title, origin, or User-Agent -> use get_page_info.
@@ -554,20 +547,19 @@ def get_content(
554
547
  """
555
548
  sb = _get_sb()
556
549
 
557
- if output_format == "urls":
558
- return sb.get_all_urls(selector=selector)
559
-
560
- if selector is None:
561
- if output_format == "html":
562
- return sb.get_page_source(
563
- include_shadow_dom=include_shadow_dom
564
- )
565
- return sb.get_text("body")
550
+ if output_format == "text":
551
+ return sb.get_text(selector, timeout=timeout)
566
552
 
567
553
  if output_format == "html":
568
- return sb.get_element_html(selector)
554
+ return sb.get_element_html(selector, timeout=timeout)
569
555
 
570
- return sb.get_text(selector)
556
+ if output_format == "urls":
557
+ return sb.get_all_urls(selector=selector, timeout=timeout)
558
+
559
+ return (
560
+ f"Error: unknown output_format '{output_format}'. "
561
+ "Use 'text', 'html', or 'urls'."
562
+ )
571
563
 
572
564
 
573
565
  @mcp.tool()
@@ -575,22 +567,24 @@ def get_content(
575
567
  def get_attributes(
576
568
  selector: str,
577
569
  attribute: str | None = None,
578
- ) -> Any:
579
- """Read HTML attributes from a matching element.
570
+ timeout: float = 5,
571
+ ) -> str | dict[str, Any] | None:
572
+ """Read HTML attributes from the first matching element.
580
573
 
581
- Use this tool when you need the value of one or more HTML attributes
582
- such as href, src, value, class, id, name, type, aria-label, or data-*.
574
+ Use this tool when you need the value of a specific HTML attribute,
575
+ or all HTML attributes of an element. Attributes could be something
576
+ such as href, src, value, class, id, name, type, aria-label, etc.
583
577
 
584
578
  Args:
585
- selector: CSS selector or SeleniumBase text-matching selector for
586
- the target element.
579
+ selector: CSS selector or SeleniumBase-supported XPath selector.
587
580
 
588
581
  attribute: Specific HTML attribute to retrieve. When omitted, return
589
- all HTML attributes of the element as a dictionary.
582
+ all HTML attributes of the first matching element as a dictionary.
583
+
584
+ timeout: Maximum seconds to wait for the target element. Default: 5.
590
585
 
591
586
  Returns:
592
- The requested attribute value, or a dictionary containing all
593
- HTML attributes of the element when attribute is omitted.
587
+ The requested attribute(s).
594
588
 
595
589
  Tool selection:
596
590
  - Need one or more HTML attribute values from a specific element ->
@@ -601,13 +595,16 @@ def get_attributes(
601
595
  - Need to check element presence/visibility -> use 'check_condition'.
602
596
 
603
597
  This is a read-only operation.
598
+
599
+ If there's no matching element found within the timeout,
600
+ then @handle_sb_errors will return details from the exception raised.
604
601
  """
605
602
  sb = _get_sb()
606
603
 
607
604
  if attribute:
608
- return sb.get_attribute(selector, attribute)
605
+ return sb.get_attribute(selector, attribute, timeout=timeout)
609
606
 
610
- return sb.get_element_attributes(selector)
607
+ return sb.get_element_attributes(selector, timeout=timeout)
611
608
 
612
609
 
613
610
  @mcp.tool()
@@ -963,6 +960,7 @@ def focus(
963
960
  "focus",
964
961
  "highlight",
965
962
  ] = "scroll_to_element",
963
+ timeout: float = 5,
966
964
  ) -> str:
967
965
  """Scroll to, focus, or highlight an element.
968
966
 
@@ -976,16 +974,22 @@ def focus(
976
974
  - "scroll_to_element": Scroll the element into the viewport.
977
975
  - "focus": Move keyboard focus to the element.
978
976
  - "highlight": Temporarily highlight the element for debugging or
979
- demonstration. May affect timing and reduce stealth.
977
+ demonstration by changing the border color. May affect timing
978
+ and/or reduce stealth.
979
+
980
+ timeout: Maximum seconds to wait for the target element. Default: 5.
981
+
982
+ If there's no matching element found within the timeout,
983
+ then @handle_sb_errors will return details from the exception raised.
980
984
  """
981
985
  sb = _get_sb()
982
986
 
983
987
  if action == "scroll_to_element":
984
- sb.scroll_into_view(selector)
988
+ sb.scroll_into_view(selector, timeout=timeout)
985
989
  elif action == "focus":
986
- sb.find_element(selector).focus()
990
+ sb.find_element(selector, timeout=timeout).focus()
987
991
  elif action == "highlight":
988
- sb.highlight(selector)
992
+ sb.highlight(selector, timeout=timeout)
989
993
  else:
990
994
  return (
991
995
  f"Error: unknown action '{action}'. "
@@ -1,2 +1,2 @@
1
1
  # seleniumbase package
2
- __version__ = "4.54.1"
2
+ __version__ = "4.54.2"
@@ -827,7 +827,7 @@ class CDPMethods():
827
827
  driver = driver.cdp_base
828
828
  return self.loop.run_until_complete(driver.reset_permissions())
829
829
 
830
- def get_all_urls(self, absolute=True, selector=None):
830
+ def get_all_urls(self, absolute=True, selector=None, timeout=None):
831
831
  """
832
832
  Convenience function that returns all links (a,link,img,script).
833
833
  :param absolute:
@@ -838,13 +838,15 @@ class CDPMethods():
838
838
  instead of the entire page.
839
839
  :return: List of URLs.
840
840
  """
841
+ if not timeout:
842
+ timeout = settings.SMALL_TIMEOUT
841
843
  if isinstance(absolute, str) and selector is None:
842
844
  # The `selector` is usually first, so the user may get confused.
843
845
  # Therefore, if first arg is string, it's probably the selector.
844
846
  selector = absolute
845
847
  absolute = True
846
848
  if selector:
847
- html = self.find_element(selector).get_html()
849
+ html = self.find_element(selector, timeout=timeout).get_html()
848
850
  soup = self.get_beautiful_soup(html)
849
851
  page_url = self.get_current_url()
850
852
  return page_utils._get_unique_links(page_url, soup)
@@ -1876,8 +1878,11 @@ class CDPMethods():
1876
1878
  def get_flattened_document(self):
1877
1879
  return self.loop.run_until_complete(self.page.get_flattened_document())
1878
1880
 
1879
- def get_element_attributes(self, selector):
1881
+ def get_element_attributes(self, selector, timeout=None):
1882
+ if not timeout:
1883
+ timeout = settings.SMALL_TIMEOUT
1880
1884
  selector = self.__convert_to_css_if_xpath(selector)
1885
+ self.find_element(selector, timeout=timeout)
1881
1886
  return self.loop.run_until_complete(
1882
1887
  self.page.js_dumps(
1883
1888
  """document.querySelector('%s')"""
@@ -1885,10 +1890,13 @@ class CDPMethods():
1885
1890
  )
1886
1891
  )
1887
1892
 
1888
- def get_element_attribute(self, selector, attribute):
1893
+ def get_element_attribute(self, selector, attribute, timeout=None):
1889
1894
  """Find an element and return the value of an attribute.
1890
1895
  Raises an exception if there's no such element or attribute."""
1891
- attributes = self.get_element_attributes(selector)
1896
+ if not timeout:
1897
+ timeout = settings.SMALL_TIMEOUT
1898
+ selector = self.__convert_to_css_if_xpath(selector)
1899
+ attributes = self.get_element_attributes(selector, timeout=timeout)
1892
1900
  with suppress(Exception):
1893
1901
  return attributes[attribute]
1894
1902
  locate = ' %s="' % attribute
@@ -3685,8 +3693,10 @@ class CDPMethods():
3685
3693
  with suppress(Exception):
3686
3694
  self.loop.run_until_complete(self.page.evaluate(js_code))
3687
3695
 
3688
- def scroll_into_view(self, selector):
3689
- self.find_element(selector).scroll_into_view()
3696
+ def scroll_into_view(self, selector, timeout=None):
3697
+ if not timeout:
3698
+ timeout = settings.SMALL_TIMEOUT
3699
+ self.find_element(selector, timeout=timeout).scroll_into_view()
3690
3700
  self.loop.run_until_complete(self.page.wait(0.05))
3691
3701
 
3692
3702
  def scroll_to_y(self, y):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seleniumbase
3
- Version: 4.54.1
3
+ Version: 4.54.2
4
4
  Summary: SeleniumBase is a framework for web crawling, scraping, and testing. Supports pytest. CDP Mode adds stealth. Includes many tools.
5
5
  Home-page: https://github.com/seleniumbase/SeleniumBase
6
6
  Author: Michael Mintz
@@ -171,6 +171,7 @@ Dynamic: requires-python
171
171
  Dynamic: summary
172
172
 
173
173
  <!-- SeleniumBase Docs -->
174
+ <!-- mcp-name: io.github.seleniumbase/seleniumbase -->
174
175
 
175
176
  <meta property="og:site_name" content="SeleniumBase">
176
177
  <meta property="og:title" content="SeleniumBase: Stealthy Chromium Automation with Python; and E2E Testing." />
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes