seleniumbase 4.54.1__tar.gz → 4.54.3__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.
- {seleniumbase-4.54.1/seleniumbase.egg-info → seleniumbase-4.54.3}/PKG-INFO +2 -1
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/README.md +1 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/mcp_servers/server.py +132 -135
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/__version__.py +1 -1
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/sb_cdp.py +17 -7
- {seleniumbase-4.54.1 → seleniumbase-4.54.3/seleniumbase.egg-info}/PKG-INFO +2 -1
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/.gitignore +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/LICENSE +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/MANIFEST.in +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/install.sh +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/mcp_servers/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/pyproject.toml +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/pytest.ini +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/requirements.txt +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/sbase/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/sbase/__main__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/sbase/steps.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/__main__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/behave/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/behave/behave_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/behave/behave_sb.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/behave/steps.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/common/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/common/decorators.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/common/encryption.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/common/exceptions.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/common/obfuscate.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/common/unobfuscate.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/config/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/config/ad_block_list.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/config/proxy_list.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/config/settings.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/logo_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/rich_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/run.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_behave_gui.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_caseplans.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_commander.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_install.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_mkchart.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_mkdir.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_mkfile.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_mkpres.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_mkrec.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_objectify.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_print.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/console_scripts/sb_recorder.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/application_manager.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/browser_launcher.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/capabilities_parser.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/colored_traceback.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/create_db_tables.sql +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/detect_b_ver.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/download_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/encoded_images.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/jqc_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/log_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/mysql.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/nest_asyncio.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/proxy_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/recorder_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/report_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/s3_manager.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/sb_driver.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/session_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/settings_parser.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/style_sheet.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/testcase_manager.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/tour_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/core/visual_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/drivers/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/drivers/brave_drivers/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/drivers/cft_drivers/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/drivers/chromium_drivers/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/drivers/chs_drivers/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/drivers/comet_drivers/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/drivers/opera_drivers/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/extensions/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/extensions/ad_block.zip +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/extensions/disable_csp.zip +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/extensions/recorder.zip +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/extensions/sbase_ext.zip +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/base_case.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/constants.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/css_to_xpath.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/errors.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/js_utils.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/page_actions.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/page_utils.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/shared_utils.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/unittest_helper.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/words.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/fixtures/xpath_to_css.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/js_code/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/js_code/active_css_js.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/js_code/live_js.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/js_code/recorder_js.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/masterqa/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/masterqa/master_qa.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/base_plugin.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/basic_test_info.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/db_reporting_plugin.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/driver_manager.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/page_source.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/pytest_plugin.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/s3_logging_plugin.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/sb_manager.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/screen_shots.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/plugins/selenium_plugin.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/resources/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/chinese.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/dutch.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/french.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/italian.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/japanese.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/korean.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/master_dict.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/portuguese.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/russian.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/spanish.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/translate/translator.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp_driver/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp_driver/_contradict.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp_driver/browser.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp_driver/cdp_util.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp_driver/config.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp_driver/connection.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp_driver/element.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/cdp_driver/tab.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/dprocess.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/options.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/patcher.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/reactor.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/undetected/webelement.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/download_selenium_server.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/font_color +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/grid-hub +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/grid-node +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/grid_hub.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/grid_node.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/register-grid-node.bat +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/register-grid-node.sh +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/start-grid-hub.bat +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_grid/start-grid-hub.sh +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_ide/__init__.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase/utilities/selenium_ide/convert_ide.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase.egg-info/SOURCES.txt +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase.egg-info/dependency_links.txt +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase.egg-info/entry_points.txt +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase.egg-info/requires.txt +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/seleniumbase.egg-info/top_level.txt +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/setup.cfg +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/setup.py +0 -0
- {seleniumbase-4.54.1 → seleniumbase-4.54.3}/virtualenv_install.sh +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: seleniumbase
|
|
3
|
-
Version: 4.54.
|
|
3
|
+
Version: 4.54.3
|
|
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." />
|
|
@@ -34,7 +34,8 @@ having to choose between multiple near-identical tools.
|
|
|
34
34
|
|
|
35
35
|
Tool-selection philosophy:
|
|
36
36
|
- Use 'start_browser'/'close_browser' for opening/quitting the web browser.
|
|
37
|
-
- Use '
|
|
37
|
+
- Use 'goto_url'/'manage_history' for browser navigation and history
|
|
38
|
+
inspection.
|
|
38
39
|
- Use 'get_page_info' for reading browser/page metadata such as URL/title.
|
|
39
40
|
- Use 'get_content'/'get_attributes' for reading text, HTML, or attributes.
|
|
40
41
|
- Use 'find_elements' for discovering and inspecting multiple matching
|
|
@@ -43,11 +44,12 @@ Tool-selection philosophy:
|
|
|
43
44
|
- Use 'wait_for' when the agent needs to wait for a condition to become true.
|
|
44
45
|
- Use 'assert_condition' when the agent needs to verify an expected condition
|
|
45
46
|
and treat failure as an assertion error.
|
|
46
|
-
- Use '
|
|
47
|
+
- Use 'click_element'/'type_text'/'select_option' for standard page
|
|
48
|
+
interactions.
|
|
47
49
|
- Use 'hover_action' for just a hover, with a click, or with a drag/drop.
|
|
48
|
-
- Use '
|
|
50
|
+
- Use 'focus_element' for element positioning and visual focus.
|
|
49
51
|
- Use 'solve_captcha' for clicking the checkbox of a CAPTCHA on the page.
|
|
50
|
-
- Use '
|
|
52
|
+
- Use 'save_page' for saving page output as a PNG, a PDF, or an HTML file.
|
|
51
53
|
"""
|
|
52
54
|
from __future__ import annotations
|
|
53
55
|
import atexit
|
|
@@ -109,8 +111,8 @@ def start_browser(
|
|
|
109
111
|
) -> str:
|
|
110
112
|
"""Launch a persistent SeleniumBase Pure CDP Mode browser session.
|
|
111
113
|
|
|
112
|
-
Call this before using browser interaction tools such as
|
|
113
|
-
get_content,
|
|
114
|
+
Call this before using browser interaction tools such as goto_url,
|
|
115
|
+
get_content, click_element, type_text, or find_elements. The same browser
|
|
114
116
|
session remains active across subsequent MCP tool calls until
|
|
115
117
|
close_browser is called or the server process exits.
|
|
116
118
|
|
|
@@ -336,7 +338,7 @@ def get_page_info() -> dict[str, Any]:
|
|
|
336
338
|
|
|
337
339
|
@mcp.tool()
|
|
338
340
|
@handle_sb_errors
|
|
339
|
-
def
|
|
341
|
+
def goto_url(url: str) -> str:
|
|
340
342
|
"""Navigate the current browser tab to a URL.
|
|
341
343
|
|
|
342
344
|
Use this when the browser needs to visit a new URL rather than move
|
|
@@ -358,7 +360,7 @@ def navigate(url: str) -> str:
|
|
|
358
360
|
A confirmation message containing the requested URL.
|
|
359
361
|
|
|
360
362
|
Tool selection:
|
|
361
|
-
- Go to a new URL -> use
|
|
363
|
+
- Go to a new URL -> use goto_url.
|
|
362
364
|
- Return to the previous page -> use manage_history(action="back").
|
|
363
365
|
- Go forward in history -> use manage_history(action="forward").
|
|
364
366
|
- Refresh the current page -> use manage_history(action="reload").
|
|
@@ -377,7 +379,7 @@ def manage_history(
|
|
|
377
379
|
|
|
378
380
|
Use 'back' or 'forward' for history navigation, 'reload' to refresh
|
|
379
381
|
while bypassing the cache, or 'list' to inspect history.
|
|
380
|
-
Use '
|
|
382
|
+
Use 'goto_url' for navigation to an arbitrary URL.
|
|
381
383
|
|
|
382
384
|
Args:
|
|
383
385
|
action:
|
|
@@ -446,10 +448,16 @@ def find_elements(
|
|
|
446
448
|
dictionaries. It does not return live SeleniumBase element objects.
|
|
447
449
|
|
|
448
450
|
Args:
|
|
449
|
-
selector: A
|
|
451
|
+
selector: A CSS selector, or an XPath selector that SeleniumBase can
|
|
452
|
+
convert to CSS. In sb.find_elements, SeleniumBase automatically
|
|
453
|
+
attempts to convert XPath to CSS. Some XPath expressions, such
|
|
454
|
+
as those using `contains(...)`, cannot be converted to CSS and
|
|
455
|
+
therefore aren't supported by this tool.
|
|
450
456
|
|
|
451
457
|
timeout: Maximum number of seconds to wait for at least one matching
|
|
452
|
-
element to appear.
|
|
458
|
+
element to appear. If the selector is an XPath selector that
|
|
459
|
+
cannot be converted into a valid CSS selector, then the wait
|
|
460
|
+
might be less than the timeout.
|
|
453
461
|
|
|
454
462
|
include_html: If True, include each matching element's outer HTML.
|
|
455
463
|
If False, return only tag name and text.
|
|
@@ -459,115 +467,102 @@ def find_elements(
|
|
|
459
467
|
- count: Number of matching elements found.
|
|
460
468
|
- matches: A list of element dictionaries containing tag_name and
|
|
461
469
|
text, plus html when include_html=True.
|
|
462
|
-
If there's an error,
|
|
470
|
+
If there's an error during search, then "error" is added into the
|
|
471
|
+
returned dictionary with error details.
|
|
463
472
|
|
|
464
473
|
Tool selection:
|
|
465
474
|
- Need structured information about matching elements ->
|
|
466
475
|
use find_elements.
|
|
467
476
|
- Need the visible text/HTML of a page or a single element ->
|
|
468
477
|
use get_content.
|
|
469
|
-
- Need to click one of several matches -> use
|
|
478
|
+
- Need to click one of several matches -> use click_element with nth.
|
|
470
479
|
- Need to know whether an element is present/visible ->
|
|
471
480
|
use check_condition.
|
|
472
481
|
|
|
473
|
-
|
|
482
|
+
Notes:
|
|
474
483
|
Element handles cannot be persisted across MCP calls. If you find
|
|
475
484
|
elements and then need to act on one, resolve it again with the
|
|
476
485
|
appropriate interaction tool.
|
|
486
|
+
|
|
487
|
+
For uncaught errors, @handle_sb_errors returns strings.
|
|
477
488
|
"""
|
|
478
489
|
sb = _get_sb()
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
490
|
+
try:
|
|
491
|
+
elements = sb.find_elements(selector, timeout=timeout)
|
|
492
|
+
except Exception as e:
|
|
482
493
|
return {
|
|
483
|
-
"count":
|
|
484
|
-
"matches": [
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
494
|
+
"count": 0,
|
|
495
|
+
"matches": [],
|
|
496
|
+
"error": str(e),
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
matches = []
|
|
500
|
+
for element in elements:
|
|
501
|
+
match = {
|
|
502
|
+
"tag_name": element.tag_name,
|
|
503
|
+
"text": element.text,
|
|
492
504
|
}
|
|
505
|
+
if include_html:
|
|
506
|
+
match["html"] = element.get_html()
|
|
507
|
+
matches.append(match)
|
|
493
508
|
|
|
494
509
|
return {
|
|
495
|
-
"count": len(
|
|
496
|
-
"matches":
|
|
497
|
-
{
|
|
498
|
-
"tag_name": element.tag_name,
|
|
499
|
-
"text": element.text,
|
|
500
|
-
}
|
|
501
|
-
for element in elements
|
|
502
|
-
],
|
|
510
|
+
"count": len(matches),
|
|
511
|
+
"matches": matches,
|
|
503
512
|
}
|
|
504
513
|
|
|
505
514
|
|
|
506
515
|
@mcp.tool()
|
|
507
516
|
@handle_sb_errors
|
|
508
517
|
def get_content(
|
|
509
|
-
selector: str
|
|
518
|
+
selector: str = "body",
|
|
510
519
|
output_format: Literal["text", "html", "urls"] = "text",
|
|
511
|
-
|
|
520
|
+
timeout: float = 5,
|
|
512
521
|
) -> str | list[str]:
|
|
513
|
-
"""Read visible text, HTML, or discovered URLs from the
|
|
522
|
+
"""Read visible text, HTML, or discovered URLs from the selected element.
|
|
514
523
|
|
|
515
|
-
Use this tool when you need actual page content or URL information
|
|
516
|
-
than page metadata.
|
|
524
|
+
Use this tool when you need to get actual page content or URL information
|
|
525
|
+
rather than page metadata.
|
|
517
526
|
|
|
518
527
|
Args:
|
|
519
|
-
selector:
|
|
520
|
-
|
|
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.
|
|
528
|
+
selector: CSS selector or SeleniumBase-supported XPath selector.
|
|
529
|
+
Default: "body".
|
|
525
530
|
|
|
526
531
|
output_format:
|
|
527
|
-
- "text": Return visible text from the
|
|
528
|
-
- "html": Return HTML from the
|
|
529
|
-
- "urls": Return URLs discovered by SeleniumBase
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
SeleniumBase returns full URLs with their URL protocol prefixes.
|
|
533
|
-
|
|
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.
|
|
532
|
+
- "text": Return visible text from the selected element.
|
|
533
|
+
- "html": Return HTML from the selected element.
|
|
534
|
+
- "urls": Return URLs discovered by SeleniumBase within the
|
|
535
|
+
selected element. Returned URLs are normalized to full URLs
|
|
536
|
+
with their protocol prefixes.
|
|
537
537
|
|
|
538
|
-
|
|
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.
|
|
538
|
+
timeout: Maximum seconds to wait for the target element. Default: 5.
|
|
544
539
|
|
|
545
540
|
Tool selection:
|
|
546
541
|
- Need URL, title, origin, or User-Agent -> use get_page_info.
|
|
547
|
-
- Need visible text -> use
|
|
548
|
-
- Need page or element HTML -> use output_format="html".
|
|
549
|
-
- Need URLs from the page or an element -> use output_format="urls".
|
|
542
|
+
- Need visible text, html, or URLs on a page -> use get_content.
|
|
550
543
|
- Need structured information about matching elements ->
|
|
551
544
|
use find_elements.
|
|
552
545
|
- Need to check element presence/visibility -> use check_condition.
|
|
553
546
|
- Need to wait for content to appear -> use wait_for.
|
|
547
|
+
|
|
548
|
+
If there's no matching element found within the timeout,
|
|
549
|
+
then @handle_sb_errors returns details from the exception raised.
|
|
554
550
|
"""
|
|
555
551
|
sb = _get_sb()
|
|
556
552
|
|
|
557
|
-
if output_format == "
|
|
558
|
-
return sb.
|
|
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")
|
|
553
|
+
if output_format == "text":
|
|
554
|
+
return sb.get_text(selector, timeout=timeout)
|
|
566
555
|
|
|
567
556
|
if output_format == "html":
|
|
568
|
-
return sb.get_element_html(selector)
|
|
557
|
+
return sb.get_element_html(selector, timeout=timeout)
|
|
569
558
|
|
|
570
|
-
|
|
559
|
+
if output_format == "urls":
|
|
560
|
+
return sb.get_all_urls(selector=selector, timeout=timeout)
|
|
561
|
+
|
|
562
|
+
return (
|
|
563
|
+
f"Error: unknown output_format '{output_format}'. "
|
|
564
|
+
"Use 'text', 'html', or 'urls'."
|
|
565
|
+
)
|
|
571
566
|
|
|
572
567
|
|
|
573
568
|
@mcp.tool()
|
|
@@ -575,22 +570,21 @@ def get_content(
|
|
|
575
570
|
def get_attributes(
|
|
576
571
|
selector: str,
|
|
577
572
|
attribute: str | None = None,
|
|
578
|
-
|
|
579
|
-
|
|
573
|
+
timeout: float = 5,
|
|
574
|
+
) -> str | dict[str, Any] | None:
|
|
575
|
+
"""Read HTML attributes from the first matching element.
|
|
580
576
|
|
|
581
|
-
Use this tool when you need the value of
|
|
582
|
-
|
|
577
|
+
Use this tool when you need the value of a specific HTML attribute,
|
|
578
|
+
or all HTML attributes of an element. Attributes could be something
|
|
579
|
+
such as href, src, value, class, id, name, type, aria-label, etc.
|
|
583
580
|
|
|
584
581
|
Args:
|
|
585
|
-
selector: CSS selector or SeleniumBase
|
|
586
|
-
the target element.
|
|
582
|
+
selector: CSS selector or SeleniumBase-supported XPath selector.
|
|
587
583
|
|
|
588
584
|
attribute: Specific HTML attribute to retrieve. When omitted, return
|
|
589
|
-
all HTML attributes of the element as a dictionary.
|
|
585
|
+
all HTML attributes of the first matching element as a dictionary.
|
|
590
586
|
|
|
591
|
-
|
|
592
|
-
The requested attribute value, or a dictionary containing all
|
|
593
|
-
HTML attributes of the element when attribute is omitted.
|
|
587
|
+
timeout: Maximum seconds to wait for the target element. Default: 5.
|
|
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 returns 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()
|
|
@@ -683,7 +680,7 @@ def check_condition(
|
|
|
683
680
|
|
|
684
681
|
@mcp.tool()
|
|
685
682
|
@handle_sb_errors
|
|
686
|
-
def
|
|
683
|
+
def click_element(
|
|
687
684
|
selector: str,
|
|
688
685
|
nth: int | None = None,
|
|
689
686
|
all_matches: bool = False,
|
|
@@ -736,11 +733,14 @@ def click(
|
|
|
736
733
|
indexed click. Default: True.
|
|
737
734
|
|
|
738
735
|
Examples:
|
|
739
|
-
- Click one element: `
|
|
740
|
-
- Click the 2nd matching element: `
|
|
741
|
-
- Click all visible matches:
|
|
742
|
-
|
|
743
|
-
- Click
|
|
736
|
+
- Click one element: `click_element("button.submit")`
|
|
737
|
+
- Click the 2nd matching element: `click_element("button", nth=2)`
|
|
738
|
+
- Click all visible matches:
|
|
739
|
+
`click_element(".dismiss", all_matches=True)`
|
|
740
|
+
- Click only if already visible:
|
|
741
|
+
`click_element("#menu", only_if_visible=True)`
|
|
742
|
+
- Click inside a container:
|
|
743
|
+
`click_element(".item", parent_selector="#result")`
|
|
744
744
|
"""
|
|
745
745
|
sb = _get_sb()
|
|
746
746
|
|
|
@@ -771,11 +771,7 @@ def click(
|
|
|
771
771
|
def hover_action(
|
|
772
772
|
selector1: str,
|
|
773
773
|
selector2: str | None = None,
|
|
774
|
-
action: Literal[
|
|
775
|
-
"none",
|
|
776
|
-
"click",
|
|
777
|
-
"drag_and_drop",
|
|
778
|
-
] = "none",
|
|
774
|
+
action: Literal["hover", "hover_and_click", "drag_and_drop"] = "hover",
|
|
779
775
|
) -> str:
|
|
780
776
|
"""Hover over an element, optionally click another, or drag-and-drop.
|
|
781
777
|
|
|
@@ -785,46 +781,39 @@ def hover_action(
|
|
|
785
781
|
Args:
|
|
786
782
|
selector1:
|
|
787
783
|
The primary element selector.
|
|
788
|
-
For action="
|
|
789
|
-
For action="
|
|
790
|
-
clicking selector2.
|
|
784
|
+
For action="hover", this is the element to hover over.
|
|
785
|
+
For action="hover_and_click", this is the element to hover over
|
|
786
|
+
before clicking selector2.
|
|
791
787
|
For action="drag_and_drop", this is the draggable source element.
|
|
792
788
|
|
|
793
789
|
selector2:
|
|
794
790
|
The secondary element selector.
|
|
795
|
-
Required for action="
|
|
796
|
-
revealed or targeted after hovering selector1.
|
|
791
|
+
Required for action="hover_and_click", where it identifies
|
|
792
|
+
the element revealed or targeted after hovering selector1.
|
|
797
793
|
Required for action="drag_and_drop", where it identifies the
|
|
798
794
|
destination/drop target.
|
|
799
|
-
Not used for action="
|
|
795
|
+
Not used for action="hover".
|
|
800
796
|
|
|
801
797
|
action:
|
|
802
|
-
- "
|
|
803
|
-
- "
|
|
798
|
+
- "hover": Hover over selector1 only.
|
|
799
|
+
- "hover_and_click": Hover over selector1, then click selector2.
|
|
804
800
|
- "drag_and_drop": Drag selector1 and drop it onto selector2.
|
|
805
801
|
|
|
806
802
|
Returns:
|
|
807
803
|
A confirmation message describing the performed operation.
|
|
808
804
|
|
|
809
805
|
Tool selection:
|
|
810
|
-
- Simple hover -> action="
|
|
811
|
-
- Hover over one element and
|
|
806
|
+
- Simple hover -> action="hover".
|
|
807
|
+
- Hover over one element and click another -> action="hover_and_click".
|
|
812
808
|
- Drag one element onto another -> action="drag_and_drop".
|
|
813
|
-
|
|
814
|
-
Notes:
|
|
815
|
-
For action="click", selector1 is the hover target and selector2 is
|
|
816
|
-
the click target.
|
|
817
|
-
|
|
818
|
-
For action="drag_and_drop", selector1 is the source and selector2
|
|
819
|
-
is the destination.
|
|
820
809
|
"""
|
|
821
810
|
sb = _get_sb()
|
|
822
811
|
|
|
823
|
-
if action == "
|
|
812
|
+
if action == "hover":
|
|
824
813
|
sb.hover_element(selector1)
|
|
825
814
|
return f"Hovered {selector1}"
|
|
826
815
|
|
|
827
|
-
if action == "
|
|
816
|
+
if action == "hover_and_click":
|
|
828
817
|
if selector2 is None:
|
|
829
818
|
return "Error: action='click' requires selector2."
|
|
830
819
|
sb.hover_and_click(selector1, selector2)
|
|
@@ -838,7 +827,7 @@ def hover_action(
|
|
|
838
827
|
|
|
839
828
|
return (
|
|
840
829
|
f"Error: unknown action '{action}'. "
|
|
841
|
-
"Use '
|
|
830
|
+
"Use 'hover', 'hover_and_click', or 'drag_and_drop'."
|
|
842
831
|
)
|
|
843
832
|
|
|
844
833
|
|
|
@@ -937,8 +926,8 @@ def select_option(
|
|
|
937
926
|
An error when the dropdown or requested option cannot be found.
|
|
938
927
|
|
|
939
928
|
This tool is for native <select> elements. For custom JavaScript
|
|
940
|
-
dropdowns made from div/button/list elements, use
|
|
941
|
-
element-interaction tools instead.
|
|
929
|
+
dropdowns made from div/button/list elements, use click_element
|
|
930
|
+
or other element-interaction tools instead.
|
|
942
931
|
"""
|
|
943
932
|
sb = _get_sb()
|
|
944
933
|
|
|
@@ -956,18 +945,20 @@ def select_option(
|
|
|
956
945
|
|
|
957
946
|
@mcp.tool()
|
|
958
947
|
@handle_sb_errors
|
|
959
|
-
def
|
|
948
|
+
def focus_element(
|
|
960
949
|
selector: str,
|
|
961
950
|
action: Literal[
|
|
962
951
|
"scroll_to_element",
|
|
963
952
|
"focus",
|
|
964
953
|
"highlight",
|
|
965
954
|
] = "scroll_to_element",
|
|
955
|
+
timeout: float = 5,
|
|
966
956
|
) -> str:
|
|
967
957
|
"""Scroll to, focus, or highlight an element.
|
|
968
958
|
|
|
969
959
|
This tool does not click, type, select, hover, or otherwise activate the
|
|
970
|
-
element. Use `
|
|
960
|
+
element. Use `click_element`, `type_text`, or `hover_action` for those
|
|
961
|
+
operations.
|
|
971
962
|
|
|
972
963
|
Args:
|
|
973
964
|
selector: CSS selector or SeleniumBase selector identifying the target.
|
|
@@ -976,16 +967,22 @@ def focus(
|
|
|
976
967
|
- "scroll_to_element": Scroll the element into the viewport.
|
|
977
968
|
- "focus": Move keyboard focus to the element.
|
|
978
969
|
- "highlight": Temporarily highlight the element for debugging or
|
|
979
|
-
demonstration. May affect timing
|
|
970
|
+
demonstration by changing the border color. May affect timing
|
|
971
|
+
and/or reduce stealth.
|
|
972
|
+
|
|
973
|
+
timeout: Maximum seconds to wait for the target element. Default: 5.
|
|
974
|
+
|
|
975
|
+
If there's no matching element found within the timeout,
|
|
976
|
+
then @handle_sb_errors returns details from the exception raised.
|
|
980
977
|
"""
|
|
981
978
|
sb = _get_sb()
|
|
982
979
|
|
|
983
980
|
if action == "scroll_to_element":
|
|
984
|
-
sb.scroll_into_view(selector)
|
|
981
|
+
sb.scroll_into_view(selector, timeout=timeout)
|
|
985
982
|
elif action == "focus":
|
|
986
|
-
sb.find_element(selector).focus()
|
|
983
|
+
sb.find_element(selector, timeout=timeout).focus()
|
|
987
984
|
elif action == "highlight":
|
|
988
|
-
sb.highlight(selector)
|
|
985
|
+
sb.highlight(selector, timeout=timeout)
|
|
989
986
|
else:
|
|
990
987
|
return (
|
|
991
988
|
f"Error: unknown action '{action}'. "
|
|
@@ -1375,7 +1372,7 @@ def manage_storage(
|
|
|
1375
1372
|
|
|
1376
1373
|
@mcp.tool()
|
|
1377
1374
|
@handle_sb_errors
|
|
1378
|
-
def
|
|
1375
|
+
def scroll_page(
|
|
1379
1376
|
direction: Literal["up", "down", "top", "bottom"] = "down",
|
|
1380
1377
|
amount: int = 25,
|
|
1381
1378
|
) -> str:
|
|
@@ -1395,8 +1392,8 @@ def scroll(
|
|
|
1395
1392
|
Values greater than 100 for `amount` are allowed.
|
|
1396
1393
|
For example, 200 means approximately two viewport heights.
|
|
1397
1394
|
|
|
1398
|
-
Use
|
|
1399
|
-
specific element rather than scroll the page by a relative amount.
|
|
1395
|
+
Use focus_element(action="scroll_to_element") when the goal is to reveal
|
|
1396
|
+
a specific element rather than scroll the page by a relative amount.
|
|
1400
1397
|
"""
|
|
1401
1398
|
sb = _get_sb()
|
|
1402
1399
|
|
|
@@ -1502,7 +1499,7 @@ def manage_tabs(
|
|
|
1502
1499
|
"""Manage browser tabs, including opening new ones.
|
|
1503
1500
|
|
|
1504
1501
|
Use this for listing, opening, switching, or closing tabs.
|
|
1505
|
-
Use `
|
|
1502
|
+
Use `goto_url` and `manage_history` for navigation within the active tab.
|
|
1506
1503
|
|
|
1507
1504
|
Args:
|
|
1508
1505
|
action:
|
|
@@ -1617,7 +1614,7 @@ def solve_captcha() -> str:
|
|
|
1617
1614
|
|
|
1618
1615
|
@mcp.tool()
|
|
1619
1616
|
@handle_sb_errors
|
|
1620
|
-
def
|
|
1617
|
+
def save_page(
|
|
1621
1618
|
format: Literal["screenshot", "html", "pdf"] = "screenshot",
|
|
1622
1619
|
filename: str | None = None,
|
|
1623
1620
|
folder: str | None = None,
|
|
@@ -1669,7 +1666,7 @@ def save_output(
|
|
|
1669
1666
|
- Do not use this tool when you only need page metadata such as the
|
|
1670
1667
|
URL or title; use get_page_info instead.
|
|
1671
1668
|
- Do not use this tool to manipulate the page; use the appropriate
|
|
1672
|
-
interaction tool such as
|
|
1669
|
+
interaction tool such as click_element, type_text, or select_option.
|
|
1673
1670
|
|
|
1674
1671
|
Returns:
|
|
1675
1672
|
A confirmation message containing the requested output format and
|
|
@@ -1709,9 +1706,9 @@ def run_javascript(expression: str) -> Any:
|
|
|
1709
1706
|
and other same-origin page resources available to JavaScript.
|
|
1710
1707
|
|
|
1711
1708
|
Tool selection:
|
|
1712
|
-
- Prefer
|
|
1713
|
-
|
|
1714
|
-
interactions.
|
|
1709
|
+
- Prefer click_element, type_text, select_option, hover_action,
|
|
1710
|
+
focus_element, scroll_page, and other higher-level tools for normal
|
|
1711
|
+
browser interactions.
|
|
1715
1712
|
- Prefer get_content, get_attributes, and find_elements for reading
|
|
1716
1713
|
page content or element information.
|
|
1717
1714
|
- Prefer manage_storage for ordinary localStorage/sessionStorage
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
# seleniumbase package
|
|
2
|
-
__version__ = "4.54.
|
|
2
|
+
__version__ = "4.54.3"
|
|
@@ -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
|
-
|
|
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
|
-
|
|
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.
|
|
3
|
+
Version: 4.54.3
|
|
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
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|