seleniumbase 4.53.7__tar.gz → 4.53.8__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.53.7/seleniumbase.egg-info → seleniumbase-4.53.8}/PKG-INFO +1 -1
  2. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/mcp_servers/server.py +114 -81
  3. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/__version__.py +1 -1
  4. {seleniumbase-4.53.7 → seleniumbase-4.53.8/seleniumbase.egg-info}/PKG-INFO +1 -1
  5. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/.gitignore +0 -0
  6. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/LICENSE +0 -0
  7. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/MANIFEST.in +0 -0
  8. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/README.md +0 -0
  9. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/install.sh +0 -0
  10. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/mcp_servers/__init__.py +0 -0
  11. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/pyproject.toml +0 -0
  12. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/pytest.ini +0 -0
  13. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/requirements.txt +0 -0
  14. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/sbase/__init__.py +0 -0
  15. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/sbase/__main__.py +0 -0
  16. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/sbase/steps.py +0 -0
  17. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/__init__.py +0 -0
  18. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/__main__.py +0 -0
  19. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/behave/__init__.py +0 -0
  20. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/behave/behave_helper.py +0 -0
  21. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/behave/behave_sb.py +0 -0
  22. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/behave/steps.py +0 -0
  23. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/common/__init__.py +0 -0
  24. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/common/decorators.py +0 -0
  25. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/common/encryption.py +0 -0
  26. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/common/exceptions.py +0 -0
  27. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/common/obfuscate.py +0 -0
  28. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/common/unobfuscate.py +0 -0
  29. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/config/__init__.py +0 -0
  30. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/config/ad_block_list.py +0 -0
  31. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/config/proxy_list.py +0 -0
  32. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/config/settings.py +0 -0
  33. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/__init__.py +0 -0
  34. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/logo_helper.py +0 -0
  35. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/rich_helper.py +0 -0
  36. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/run.py +0 -0
  37. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_behave_gui.py +0 -0
  38. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_caseplans.py +0 -0
  39. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_commander.py +0 -0
  40. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_install.py +0 -0
  41. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_mkchart.py +0 -0
  42. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_mkdir.py +0 -0
  43. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_mkfile.py +0 -0
  44. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_mkpres.py +0 -0
  45. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_mkrec.py +0 -0
  46. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_objectify.py +0 -0
  47. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_print.py +0 -0
  48. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/console_scripts/sb_recorder.py +0 -0
  49. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/__init__.py +0 -0
  50. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/application_manager.py +0 -0
  51. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/browser_launcher.py +0 -0
  52. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/capabilities_parser.py +0 -0
  53. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/colored_traceback.py +0 -0
  54. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/create_db_tables.sql +0 -0
  55. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/detect_b_ver.py +0 -0
  56. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/download_helper.py +0 -0
  57. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/encoded_images.py +0 -0
  58. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/jqc_helper.py +0 -0
  59. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/log_helper.py +0 -0
  60. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/mysql.py +0 -0
  61. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/nest_asyncio.py +0 -0
  62. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/proxy_helper.py +0 -0
  63. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/recorder_helper.py +0 -0
  64. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/report_helper.py +0 -0
  65. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/s3_manager.py +0 -0
  66. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/sb_cdp.py +0 -0
  67. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/sb_driver.py +0 -0
  68. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/session_helper.py +0 -0
  69. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/settings_parser.py +0 -0
  70. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/style_sheet.py +0 -0
  71. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/testcase_manager.py +0 -0
  72. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/tour_helper.py +0 -0
  73. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/core/visual_helper.py +0 -0
  74. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/drivers/__init__.py +0 -0
  75. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/drivers/brave_drivers/__init__.py +0 -0
  76. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/drivers/cft_drivers/__init__.py +0 -0
  77. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/drivers/chromium_drivers/__init__.py +0 -0
  78. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/drivers/chs_drivers/__init__.py +0 -0
  79. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/drivers/comet_drivers/__init__.py +0 -0
  80. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/drivers/opera_drivers/__init__.py +0 -0
  81. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/extensions/__init__.py +0 -0
  82. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/extensions/ad_block.zip +0 -0
  83. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/extensions/disable_csp.zip +0 -0
  84. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/extensions/recorder.zip +0 -0
  85. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/extensions/sbase_ext.zip +0 -0
  86. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/__init__.py +0 -0
  87. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/base_case.py +0 -0
  88. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/constants.py +0 -0
  89. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/css_to_xpath.py +0 -0
  90. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/errors.py +0 -0
  91. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/js_utils.py +0 -0
  92. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/page_actions.py +0 -0
  93. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/page_utils.py +0 -0
  94. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/shared_utils.py +0 -0
  95. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/unittest_helper.py +0 -0
  96. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/words.py +0 -0
  97. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/fixtures/xpath_to_css.py +0 -0
  98. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/js_code/__init__.py +0 -0
  99. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/js_code/active_css_js.py +0 -0
  100. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/js_code/live_js.py +0 -0
  101. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/js_code/recorder_js.py +0 -0
  102. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/masterqa/__init__.py +0 -0
  103. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/masterqa/master_qa.py +0 -0
  104. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/__init__.py +0 -0
  105. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/base_plugin.py +0 -0
  106. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/basic_test_info.py +0 -0
  107. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/db_reporting_plugin.py +0 -0
  108. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/driver_manager.py +0 -0
  109. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/page_source.py +0 -0
  110. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/pytest_plugin.py +0 -0
  111. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/s3_logging_plugin.py +0 -0
  112. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/sb_manager.py +0 -0
  113. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/screen_shots.py +0 -0
  114. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/plugins/selenium_plugin.py +0 -0
  115. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/resources/__init__.py +0 -0
  116. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/__init__.py +0 -0
  117. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/chinese.py +0 -0
  118. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/dutch.py +0 -0
  119. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/french.py +0 -0
  120. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/italian.py +0 -0
  121. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/japanese.py +0 -0
  122. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/korean.py +0 -0
  123. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/master_dict.py +0 -0
  124. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/portuguese.py +0 -0
  125. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/russian.py +0 -0
  126. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/spanish.py +0 -0
  127. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/translate/translator.py +0 -0
  128. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/__init__.py +0 -0
  129. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp.py +0 -0
  130. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp_driver/__init__.py +0 -0
  131. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp_driver/_contradict.py +0 -0
  132. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp_driver/browser.py +0 -0
  133. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp_driver/cdp_util.py +0 -0
  134. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp_driver/config.py +0 -0
  135. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp_driver/connection.py +0 -0
  136. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp_driver/element.py +0 -0
  137. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/cdp_driver/tab.py +0 -0
  138. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/dprocess.py +0 -0
  139. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/options.py +0 -0
  140. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/patcher.py +0 -0
  141. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/reactor.py +0 -0
  142. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/undetected/webelement.py +0 -0
  143. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/__init__.py +0 -0
  144. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/__init__.py +0 -0
  145. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/download_selenium_server.py +0 -0
  146. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/font_color +0 -0
  147. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/grid-hub +0 -0
  148. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/grid-node +0 -0
  149. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/grid_hub.py +0 -0
  150. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/grid_node.py +0 -0
  151. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/register-grid-node.bat +0 -0
  152. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/register-grid-node.sh +0 -0
  153. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/start-grid-hub.bat +0 -0
  154. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_grid/start-grid-hub.sh +0 -0
  155. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_ide/__init__.py +0 -0
  156. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase/utilities/selenium_ide/convert_ide.py +0 -0
  157. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase.egg-info/SOURCES.txt +0 -0
  158. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase.egg-info/dependency_links.txt +0 -0
  159. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase.egg-info/entry_points.txt +0 -0
  160. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase.egg-info/requires.txt +0 -0
  161. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/seleniumbase.egg-info/top_level.txt +0 -0
  162. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/setup.cfg +0 -0
  163. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/setup.py +0 -0
  164. {seleniumbase-4.53.7 → seleniumbase-4.53.8}/virtualenv_install.sh +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seleniumbase
3
- Version: 4.53.7
3
+ Version: 4.53.8
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
@@ -13,11 +13,18 @@ github.com/seleniumbase/SeleniumBase/blob/master/help_docs/cdp_mode_methods.md
13
13
  Model: One persistent `sb_cdp.Chrome` session per server process.
14
14
  Call start_browser once; drive it with the other tools; then close_browser.
15
15
 
16
+ Selectors:
17
+ - CSS selectors are preferred. (All tools that take selectors support CSS.)
18
+ - XPath is accepted in several (but not all) cases. Some methods utilize
19
+ the Chrome DevTools protocol, where Xpath might not be accepted unless
20
+ SeleniumBase converts those XPath selectors into valid CSS selectors first.
21
+ - Special SeleniumBase selector syntax may be accepted by individual tools,
22
+ such as the visible text selector, e.g. `a:contains("Sign in")`.
23
+ - Tool-specific documentation takes precedence when selector behavior differs.
24
+
16
25
  Design notes:
17
- Tools follow a consistent CSS-selector-or-text matching convention:
18
- selector arguments accept a CSS selector or visible text (for example,
19
- a:contains("Sign in")). Related SeleniumBase capabilities are consolidated
20
- into parameterized tools using action, mode, state, or check parameters.
26
+ Related SeleniumBase capabilities are consolidated into parameterized tools
27
+ using action, mode, state, or check parameters.
21
28
  This keeps the toolset compact and predictable while giving an MCP client
22
29
  access to the underlying browser-automation capabilities without
23
30
  having to choose between multiple near-identical tools.
@@ -31,7 +38,7 @@ Tool-selection philosophy:
31
38
  - Use wait_for when the agent needs to wait for a condition to become true.
32
39
  - Use assert_condition when the agent needs to verify an expected condition
33
40
  and treat failure as an assertion error.
34
- - Use click/type_text/select_option/hover_with_action/focus_on for
41
+ - Use click/type_text/select_option/hover_action/focus for
35
42
  interactions and element positioning.
36
43
  """
37
44
  from __future__ import annotations
@@ -40,6 +47,7 @@ import sys
40
47
  from functools import wraps
41
48
  from typing import Any, Literal
42
49
  from mcp.server import MCPServer
50
+ from mcp.server.mcpserver.exceptions import ToolError
43
51
  from seleniumbase import sb_cdp
44
52
 
45
53
  mcp = MCPServer("seleniumbase-mcp")
@@ -50,7 +58,7 @@ _sb: sb_cdp.CDPMethods | None = None
50
58
  def _get_sb() -> sb_cdp.CDPMethods:
51
59
  """Return the active browser session or raise a useful lifecycle error."""
52
60
  if _sb is None:
53
- raise RuntimeError("No browser session. Call start_browser first.")
61
+ raise ToolError("No browser session. Call start_browser first.")
54
62
  return _sb
55
63
 
56
64
 
@@ -66,6 +74,8 @@ def handle_sb_errors(func):
66
74
  def wrapper(*args, **kwargs):
67
75
  try:
68
76
  return func(*args, **kwargs)
77
+ except ToolError:
78
+ raise
69
79
  except Exception as e:
70
80
  error_type = e.__class__.__name__
71
81
  error_msg = str(e).strip()
@@ -159,10 +169,7 @@ def start_browser(
159
169
  global _sb
160
170
 
161
171
  if _sb is not None:
162
- return (
163
- "A browser session is already running. "
164
- "Call close_browser first."
165
- )
172
+ return ("A browser session is already running.")
166
173
 
167
174
  if incognito and guest:
168
175
  return "Error: incognito and guest cannot both be enabled."
@@ -247,15 +254,19 @@ def close_browser() -> str:
247
254
  global _sb
248
255
 
249
256
  if _sb is None:
250
- return "No browser session was running."
257
+ return "No browser session is currently running."
251
258
 
252
259
  try:
253
260
  _sb.quit()
254
- except Exception:
255
- pass
261
+ except Exception as e:
262
+ return (
263
+ "Error calling `quit()` on the browser session: "
264
+ f"{e.__class__.__name__} - {str(e).strip()}"
265
+ )
266
+ finally:
267
+ _sb = None
256
268
 
257
- _sb = None
258
- return "Browser closed."
269
+ return "The browser session was closed."
259
270
 
260
271
 
261
272
  # ---------------------------------------------------------------------------
@@ -264,7 +275,7 @@ def close_browser() -> str:
264
275
 
265
276
  @mcp.tool()
266
277
  @handle_sb_errors
267
- def get_page_info() -> dict | str:
278
+ def get_page_info() -> dict:
268
279
  """Get current browser session and page metadata.
269
280
 
270
281
  Use this as the primary tool for determining where the browser currently
@@ -277,7 +288,10 @@ def get_page_info() -> dict | str:
277
288
 
278
289
  Returns:
279
290
  A dictionary containing:
280
- - running: True when a browser session is active.
291
+ - running: True when a browser session is active and metadata exists.
292
+ False if not running or there was a problem getting all metadata,
293
+ where possibly the browser crashed and therefore internally the
294
+ tool didn't realize that the browser was no longer running.
281
295
  - url: The complete current page URL, including path and query string.
282
296
  - title: The current document title.
283
297
  - origin: The current page origin (scheme, host, and port).
@@ -341,7 +355,7 @@ def navigate(url: str) -> str:
341
355
  "https://example.com" or a hostname such as "example.com".
342
356
 
343
357
  Returns:
344
- A confirmation containing the requested URL.
358
+ A confirmation message containing the requested URL.
345
359
 
346
360
  Tool selection:
347
361
  - Go to a new URL -> use navigate.
@@ -373,8 +387,8 @@ def manage_history(
373
387
  Has no useful effect when there is no forward history entry.
374
388
  - "reload": Reload the current page while ignoring the browser
375
389
  cache so page resources are fetched again.
376
- - "list": Return a tuple containing the current location in
377
- history (0-indexed) and the full navigation-history list.
390
+ - "list": Return a dictionary containing the current location
391
+ in history (0-indexed) and the full navigation-history list.
378
392
 
379
393
  Returns:
380
394
  A confirmation message describing the operation performed for
@@ -449,20 +463,20 @@ def find_elements(
449
463
  dictionaries. It does not return live SeleniumBase element objects.
450
464
 
451
465
  Args:
452
- selector: CSS selector, or a SeleniumBase selector that can match
453
- visible text. Examples include "button", ".login-link", or
454
- 'a:contains("Sign in")'.
466
+ selector: CSS Selector or XPath selector.
467
+
455
468
  timeout: Maximum number of seconds to wait for matching elements
456
- to be found. (Defaults to 0.5 seconds.)
469
+ to be found.
470
+
457
471
  include_html: If True, include each matching element's outer HTML.
458
- If False, return only tag name and text. (Defaults to False.)
472
+ If False, return only tag name and text.
459
473
 
460
474
  Returns:
461
475
  A dictionary containing:
462
476
  - count: Number of matching elements found.
463
477
  - matches: A list of element dictionaries containing tag_name and
464
478
  text, plus html when include_html=True.
465
- If there are no matching elements, returns an empty dictionary.
479
+ If there's an error, returns a string with error details.
466
480
 
467
481
  Tool selection:
468
482
  - Need structured information about matching elements ->
@@ -479,10 +493,7 @@ def find_elements(
479
493
  appropriate interaction tool.
480
494
  """
481
495
  sb = _get_sb()
482
- try:
483
- elements = sb.find_all(selector, timeout=timeout)
484
- except Exception:
485
- return {}
496
+ elements = sb.find_elements(selector, timeout=timeout)
486
497
 
487
498
  if include_html:
488
499
  return {
@@ -591,6 +602,7 @@ def get_attributes(
591
602
  Args:
592
603
  selector: CSS selector or SeleniumBase text-matching selector for
593
604
  the target element.
605
+
594
606
  attribute: Specific HTML attribute to retrieve. When omitted, return
595
607
  all HTML attributes of the element as a dictionary.
596
608
 
@@ -606,7 +618,7 @@ def get_attributes(
606
618
  - Need visible text or HTML content -> use 'get_content'.
607
619
  - Need to check element presence/visibility -> use 'check_condition'.
608
620
 
609
- This is a read-only operation and does not modify the element.
621
+ This is a read-only operation.
610
622
  """
611
623
  sb = _get_sb()
612
624
 
@@ -622,7 +634,7 @@ def check_condition(
622
634
  check: Literal["present", "visible"] = "visible",
623
635
  selector: str = "body",
624
636
  text: str | None = None,
625
- ) -> Any:
637
+ ) -> bool | str:
626
638
  """Check the current state of an element or text without waiting
627
639
  for the condition to become true.
628
640
 
@@ -636,13 +648,10 @@ def check_condition(
636
648
  The element state to inspect when text is not provided:
637
649
  - "present": Return True when at least one matching element exists.
638
650
  - "visible": Return True when the matching element is visible.
639
- Defaults to "visible".
640
651
  `check` is ignored when `text` is provided.
641
652
 
642
653
  selector:
643
- CSS selector or SeleniumBase selector identifying the element to
644
- inspect. Defaults to "body". When `text` is provided, this also
645
- identifies the element whose visible text is checked.
654
+ CSS selector or SeleniumBase selector identifying the element.
646
655
 
647
656
  text:
648
657
  Optional text to check for visibility within `selector`. When
@@ -654,16 +663,14 @@ def check_condition(
654
663
  Returns:
655
664
  True or False indicating whether the requested condition is currently
656
665
  satisfied. Missing elements return False rather than raising an
657
- exception.
666
+ exception. If there's an error, returns a string with error details.
658
667
 
659
668
  Tool selection:
660
669
  - Immediate boolean observation -> use check_condition.
661
- - Wait for an element or text condition to become true/false ->
662
- use wait_for.
663
- - Verify an expected condition and fail when it is not met ->
664
- use assert_condition.
665
- - Need the number or details of matching elements -> use find_elements.
666
- - Need to read the actual page or element content -> use get_content.
670
+ - Wait for a state/content transition -> use wait_for.
671
+ - Verify an expected condition -> use assert_condition.
672
+ - Need element details of matching elements -> use find_elements.
673
+ - Need to read page or element content -> use get_content.
667
674
 
668
675
  Notes:
669
676
  This tool does not intentionally wait for elements or text to appear.
@@ -683,7 +690,9 @@ def check_condition(
683
690
  if check == "visible":
684
691
  return sb.is_element_visible(selector)
685
692
 
686
- return f"Error: unknown check '{check}'. Use 'present' or 'visible'."
693
+ return (
694
+ f"Error: Unknown check {check!r}. Use 'present' or 'visible'."
695
+ )
687
696
 
688
697
 
689
698
  # ---------------------------------------------------------------------------
@@ -703,32 +712,36 @@ def click(
703
712
  ) -> str:
704
713
  """Click one or more elements matching a selector.
705
714
 
706
- This is the primary element-clicking tool. The selector may be a CSS
707
- selector or SeleniumBase text-matching selector such as
708
- 'a:contains("Sign in")'.
715
+ The selector may be a CSS selector or an XPath selector.
716
+ (A SeleniumBase text-matching selector such as 'a:contains("Sign in")'
717
+ can only be used only when NOT setting `all_matches`.)
709
718
 
710
719
  Args:
711
720
  selector: Target CSS selector or text-matching selector.
721
+
712
722
  nth: Click only the Nth matching element, using 1-based indexing.
713
723
  Takes priority over all_matches.
714
- all_matches: Click every currently visible matching element, in order.
715
- Ignored when nth is provided.
716
- only_if_visible: Attempt the click only when the target is already
717
- visible. Does not wait for the element to become visible.
724
+
725
+ all_matches: Click every currently visible matching element, in the
726
+ order that they appear on the page. Ignored when nth is provided.
727
+
728
+ only_if_visible: Click only when the target is already visible.
729
+ Does not wait for the element to become visible.
730
+
718
731
  parent_selector: Restrict the nested lookup to a parent element.
719
732
  Useful for elements inside iframes or nested containers when
720
733
  supported by SeleniumBase.
721
- timeout: Seconds to wait for a basic click when no specialized mode
722
- is selected. Defaults to 7 seconds.
734
+
735
+ timeout: Seconds to wait for a basic click.
736
+
723
737
  scroll: Scroll the target into view before clicking.
724
738
 
725
739
  Tool selection:
726
740
  - Click one matching element -> basic click.
727
- - Click a specific matching occurrence -> set nth.
741
+ - Click a specific matching occurrence -> set `nth`.
728
742
  - Click every visible match -> set all_matches=True.
729
743
  - Click only when already visible -> set only_if_visible=True.
730
- - Click an element nested inside another element -> set
731
- parent_selector.
744
+ - Click an element nested in another element -> set `parent_selector`.
732
745
  """
733
746
  sb = _get_sb()
734
747
 
@@ -756,7 +769,7 @@ def click(
756
769
 
757
770
  @mcp.tool()
758
771
  @handle_sb_errors
759
- def hover_with_action(
772
+ def hover_action(
760
773
  selector1: str,
761
774
  selector2: str | None = None,
762
775
  action: Literal[
@@ -765,7 +778,7 @@ def hover_with_action(
765
778
  "drag_and_drop",
766
779
  ] = "none",
767
780
  ) -> str:
768
- """Hover over an element, optionally click another element, or drag-&-drop.
781
+ """Hover over an element, optionally click another, or drag-and-drop.
769
782
 
770
783
  Use this tool for hover interactions, hover-triggered menus, and
771
784
  drag-and-drop operations.
@@ -773,23 +786,17 @@ def hover_with_action(
773
786
  Args:
774
787
  selector1:
775
788
  The primary element selector.
776
-
777
789
  For action="none", this is the element to hover over.
778
-
779
790
  For action="click", this is the element to hover over before
780
791
  clicking selector2.
781
-
782
792
  For action="drag_and_drop", this is the draggable source element.
783
793
 
784
794
  selector2:
785
795
  The secondary element selector.
786
-
787
796
  Required for action="click", where it identifies the element
788
797
  revealed or targeted after hovering selector1.
789
-
790
798
  Required for action="drag_and_drop", where it identifies the
791
799
  destination/drop target.
792
-
793
800
  Not used for action="none".
794
801
 
795
802
  action:
@@ -798,7 +805,7 @@ def hover_with_action(
798
805
  - "drag_and_drop": Drag selector1 and drop it onto selector2.
799
806
 
800
807
  Returns:
801
- A confirmation describing the performed operation.
808
+ A confirmation message describing the performed operation.
802
809
 
803
810
  Tool selection:
804
811
  - Simple hover -> action="none".
@@ -857,7 +864,9 @@ def type_text(
857
864
  Args:
858
865
  selector: CSS selector or SeleniumBase selector identifying the
859
866
  input, textarea, or contenteditable element.
867
+
860
868
  text: Text to enter or set. Not used when mode="clear_only".
869
+
861
870
  mode:
862
871
  - "fill_input": Clear the field and then type text normally.
863
872
  - "append": Keep the existing value and add text as keystrokes.
@@ -867,6 +876,7 @@ def type_text(
867
876
  key events. It can also be used to handle input sliders,
868
877
  e.g. 'input[type="range"]'.
869
878
  - "clear_only": Empty the text field; text is ignored.
879
+
870
880
  timeout: Maximum seconds to wait for the target element.
871
881
 
872
882
  Tool selection:
@@ -909,8 +919,10 @@ def select_option(
909
919
 
910
920
  Args:
911
921
  dropdown_selector: CSS selector identifying the <select> element.
922
+
912
923
  value: The option's visible text, its HTML value attribute, or its
913
924
  0-based index, depending on by.
925
+
914
926
  by:
915
927
  - "text": Match the option's visible text.
916
928
  - "value": Match the option's HTML value attribute.
@@ -940,7 +952,7 @@ def select_option(
940
952
 
941
953
  @mcp.tool()
942
954
  @handle_sb_errors
943
- def focus_on(
955
+ def focus(
944
956
  selector: str,
945
957
  action: Literal[
946
958
  "scroll_to_element",
@@ -967,12 +979,12 @@ def focus_on(
967
979
  demonstration. This can affect timing and may reduce stealth.
968
980
 
969
981
  Tool selection:
970
- - Bring an element into view -> use focus_on with the default action.
971
- - Focus an element -> use focus_on(action="focus").
972
- - Highlight element for debugging -> use focus_on(action="highlight").
982
+ - Bring an element into view -> use focus with the default action.
983
+ - Focus an element -> use focus(action="focus").
984
+ - Highlight element for debugging -> use focus(action="highlight").
973
985
  - Click -> use click.
974
986
  - Type text into a text field -> use type_text.
975
- - Hover -> use hover_with_action.
987
+ - Hover -> use hover_action.
976
988
  """
977
989
  sb = _get_sb()
978
990
 
@@ -1028,17 +1040,19 @@ def wait_for(
1028
1040
  - "not_visible": Wait until the matching element is not visible.
1029
1041
  - "absent": Wait until the matching element no longer exists.
1030
1042
  (This is handled differently when text is provided.)
1043
+
1031
1044
  selector: CSS selector or SeleniumBase selector for the element.
1032
1045
  Required unless text is supplied.
1046
+
1033
1047
  text: If supplied and is not None, a `state` of 'present' or 'visible'
1034
1048
  both wait for the text to appear within the selector, and a `state`
1035
1049
  of 'not_visible' or 'absent' both wait for the text to be absent
1036
1050
  from the selector (or within "body" when selector is omitted).
1051
+
1037
1052
  timeout: Maximum seconds to wait for the requested state to be true.
1038
- (Defaults to 7 seconds.)
1039
1053
 
1040
1054
  Returns:
1041
- A confirmation when the requested condition is reached.
1055
+ A confirmation message when the requested condition is reached.
1042
1056
 
1043
1057
  Tool selection:
1044
1058
  - Check current state immediately -> use check_condition.
@@ -1109,17 +1123,21 @@ def assert_condition(
1109
1123
  - "title": Verify the exact page title.
1110
1124
  - "url": Verify the exact current URL.
1111
1125
  - "url_contains": Verify that the current URL contains expected.
1126
+
1112
1127
  selector: Element selector for element_present, element_visible, and
1113
1128
  text_visible checks.
1129
+
1114
1130
  expected: Expected text/title/URL value for text_visible, title, url,
1115
1131
  and url_contains.
1132
+
1116
1133
  exact: For check="text_visible", require exact text
1117
1134
  rather than a substring.
1135
+
1118
1136
  timeout: Maximum seconds to wait for element/text checks.
1119
1137
  (Ignored for title and URL checks.)
1120
1138
 
1121
1139
  Returns:
1122
- A confirmation when the expectation passes.
1140
+ A confirmation message when the expectation passes.
1123
1141
 
1124
1142
  Raises:
1125
1143
  An assertion-related SeleniumBase exception when the expectation
@@ -1202,8 +1220,9 @@ def manage_cookies(
1202
1220
  created or overwritten.
1203
1221
  - "load": Load cookies from filename into the current browser
1204
1222
  session.
1205
- filename: Filesystem path used by save/load. Defaults to
1206
- "cookies.txt". Ignored for get_all and clear.
1223
+
1224
+ filename: Filesystem path used by save/load.
1225
+ Ignored for get_all and clear.
1207
1226
 
1208
1227
  Returns:
1209
1228
  "get_all": Current browser cookies.
@@ -1280,8 +1299,11 @@ def manage_storage(
1280
1299
 
1281
1300
  Args:
1282
1301
  key: Storage key to read or modify.
1302
+
1283
1303
  value: Value to store when action="set". Required for set.
1304
+
1284
1305
  storage: "local" for localStorage or "session" for sessionStorage.
1306
+
1285
1307
  action: "get" to read the key or "set" to write the key.
1286
1308
 
1287
1309
  Returns:
@@ -1337,11 +1359,12 @@ def scroll(
1337
1359
  - "down": Scroll downward by amount percent of the window height.
1338
1360
  - "top": Scroll directly to the top; amount is ignored.
1339
1361
  - "bottom": Scroll directly to the bottom; amount is ignored.
1362
+
1340
1363
  amount: Percentage of the current viewport height used for relative
1341
1364
  up/down scrolling. For example, amount=25 scrolls approximately
1342
1365
  one quarter of the viewport height.
1343
1366
 
1344
- Use focus_on(action="scroll_to_element") when the goal is to reveal a
1367
+ Use focus(action="scroll_to_element") when the goal is to reveal a
1345
1368
  specific element rather than scroll the page by a relative amount.
1346
1369
  """
1347
1370
  sb = _get_sb()
@@ -1391,9 +1414,13 @@ def manage_window(
1391
1414
  - "set_rect": Set x, y, width, and height. All four are required.
1392
1415
  - "maximize": Maximize the browser window.
1393
1416
  - "minimize": Minimize the browser window.
1417
+
1394
1418
  x: Horizontal screen position for set_rect.
1419
+
1395
1420
  y: Vertical screen position for set_rect.
1421
+
1396
1422
  width: Window width for set_rect.
1423
+
1397
1424
  height: Window height for set_rect.
1398
1425
 
1399
1426
  Use this tool for browser-window geometry/state. For switching between
@@ -1451,10 +1478,12 @@ def manage_tabs(
1451
1478
  - "switch": Switch to the tab identified by tab_index from list.
1452
1479
  - "switch_newest": Switch to the newest tab.
1453
1480
  - "close_active": Close the currently active tab.
1481
+
1454
1482
  url: URL for action="open".
1483
+
1455
1484
  tab_index: Index returned by action="list" for action="switch".
1456
- switch_to: For action="open", switch to the newly created tab when
1457
- True.
1485
+
1486
+ switch_to: For action="open", switch to the new tab when True.
1458
1487
 
1459
1488
  Notes:
1460
1489
  Clicking a link or performing another browser action may open a new
@@ -1565,12 +1594,14 @@ def save_output(
1565
1594
  - "screenshot": Save a PNG screenshot.
1566
1595
  - "html": Save the current page source as HTML.
1567
1596
  - "pdf": Save the current page as a PDF.
1597
+
1568
1598
  filename: Output filename. Defaults to screenshot.png,
1569
1599
  page_source.html, or page.pdf depending on format.
1600
+
1570
1601
  folder: Optional destination folder.
1571
1602
 
1572
1603
  Returns:
1573
- A confirmation containing the output format and filename.
1604
+ A confirmation message containing the output format and filename.
1574
1605
 
1575
1606
  Security:
1576
1607
  filename and folder can affect filesystem paths available to the MCP
@@ -1611,8 +1642,8 @@ def run_javascript(expression: str) -> Any:
1611
1642
  and other same-origin page resources available to JavaScript.
1612
1643
 
1613
1644
  Tool selection:
1614
- - Prefer click, type_text, select_option, hover_with_action,
1615
- focus_on, scroll, and other higher-level tools for normal browser
1645
+ - Prefer click, type_text, select_option, hover_action,
1646
+ focus, scroll, and other higher-level tools for normal browser
1616
1647
  interactions.
1617
1648
  - Prefer get_content, get_attributes, and find_elements for reading
1618
1649
  page content or element information.
@@ -1669,6 +1700,8 @@ def wait_seconds(seconds: float) -> str:
1669
1700
  Args:
1670
1701
  seconds: Number of seconds to block. May be an integer or float.
1671
1702
  """
1703
+ if seconds < 0:
1704
+ return "Error: seconds must be >= 0."
1672
1705
  _get_sb().sleep(seconds)
1673
1706
  return f"Waited {seconds}s"
1674
1707
 
@@ -1,2 +1,2 @@
1
1
  # seleniumbase package
2
- __version__ = "4.53.7"
2
+ __version__ = "4.53.8"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: seleniumbase
3
- Version: 4.53.7
3
+ Version: 4.53.8
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
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes