tool_get_text
Finds an element by CSS or XPath selector and returns its text content. Use for extracting visible text from web page elements.
Instructions
Get text from an element.
This tool finds an element and returns its text content.
Args:
selector (str): The selector to find the element
by (str, optional): The selector type. Either "css" or "xpath". Defaults to "css"
Returns:
Dict[str, Any]: A dictionary containing:
- success (bool): Whether the operation was successful
- message (str): Status message
- data (str): The text content of the element
Example:
{"tool": "get_text", "args": {"selector": "h1"}}
{"tool": "get_text", "args": {"selector": "//div[@class='content']", "by": "xpath"}}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| selector | Yes | ||
| by | No | css |