text_around
Extract surrounding text from a web page around a specified element or text match, returning before, match, and after segments for contextual analysis.
Instructions
Return cleaned surrounding text around an element ref or the best ranked text match. Returns {ref, before, match, after, text}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional element ref like e:142 | |
| text | No | Optional text to locate when ref is omitted | |
| selector | No | Optional CSS selector to scope context | |
| context_chars | No | Characters before/after the target (default 400) |