Get Content
get_contentExtract visible text, HTML, or URLs from any page element using a CSS or XPath selector.
Instructions
Read visible text, HTML, or discovered URLs from the selected element.
Use this tool when you need to get actual page content or URL information rather than page metadata.
Args: selector: CSS selector or SeleniumBase-supported XPath selector. Default: "body".
output_format:
- "text": Return visible text from the selected element.
- "html": Return HTML from the selected element.
- "urls": Return URLs discovered by SeleniumBase within the
selected element. Returned URLs are normalized to full URLs
with their protocol prefixes.
timeout: Maximum seconds to wait for the target element. Default: 5.Tool selection: - Need URL, title, origin, or User-Agent -> use get_page_info. - Need visible text, html, or URLs on a page -> use get_content. - Need structured information about matching elements -> use find_elements. - Need to check element presence/visibility -> use check_if_condition. - Need to wait for content to appear -> use wait_for_condition.
If there's no matching element found within the timeout, then @handle_sb_errors returns details from the exception raised.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| timeout | No | ||
| selector | No | body | |
| output_format | No | text |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| result | Yes |