[docs]: add ignoreSelectors to docs for extract()#2088
Open
seanmcguire12 wants to merge 1 commit intomainfrom
Open
[docs]: add ignoreSelectors to docs for extract()#2088seanmcguire12 wants to merge 1 commit intomainfrom
ignoreSelectors to docs for extract()#2088seanmcguire12 wants to merge 1 commit intomainfrom
Conversation
|
Contributor
There was a problem hiding this comment.
No issues found across 2 files
Confidence score: 5/5
- Automated review surfaced no issues in the provided summaries.
- No files require special attention.
Architecture diagram
sequenceDiagram
participant Client as User Code
participant Stagehand as Stagehand Instance
participant Extractor as Extract Engine
participant DOM as DOM Snapshot Processor
participant LLM as LLM Provider
Note over Client,LLM: Core extract() flow with ignoreSelectors support
Client->>Stagehand: extract(instruction, schema, { ignoreSelectors, selector? })
Stagehand->>Extractor: process extraction request
alt selector provided
Extractor->>DOM: apply selector to locate target subtree
DOM-->>Extractor: scoped DOM root
else no selector
Extractor->>DOM: capture full page DOM
DOM-->>Extractor: full DOM tree
end
Note over DOM: CHANGED FLOW: ignoreSelectors filtering
opt ignoreSelectors array provided
Extractor->>DOM: filter out matching nodes and descendants
DOM->>DOM: for each selector in ignoreSelectors
DOM->>DOM: remove all matched elements + children
DOM-->>Extractor: cleaned DOM snapshot
end
Extractor->>LLM: send instruction + schema + filtered snapshot
LLM-->>Extractor: structured response
Extractor->>Extractor: validate against schema
alt validation passes
Extractor-->>Stagehand: extracted data object
else validation fails
Extractor-->>Stagehand: error (LLMResponseError)
end
Stagehand-->>Client: return result or error
Contributor
|
Preview deployment for your docs. Learn more about Mintlify Previews.
💡 Tip: Enable Workflows to automatically generate PRs for you. |
miguelg719
approved these changes
May 6, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
what changed
Summary by cubic
Documented the new
ignoreSelectorsoption forextract()to exclude elements (and their descendants) from the snapshot. Added a targeted-extract example and clarified how it interacts withselector, plus minor wording updates for supported page types.Written for commit f039e45. Summary will update on new commits.