Provides advanced filtering criteria for element selection, often used in conjunction with ElementOptions. These filters are applied AFTER an initial set of elements is found by the main selector in ElementOptions.Documentation Index
Fetch the complete documentation index at: https://docs.extractbase.com/llms.txt
Use this file to discover all available pages before exploring further.
Definition
Fields
has
ElementOptions
Narrows down the selection to elements that have a descendant matching these ElementOptions.
Example: To find a list item that contains a link with text “Details”:
element(selector: "li", filter: { has: { role: "link", text: "Details" } })
hasNot
ElementOptions
Narrows down the selection to elements that DO NOT have a descendant matching these ElementOptions.
Example: To find a product item that does not contain a “Sold Out” badge:
element(selector: ".product", filter: { hasNot: { text: "Sold Out" } })
hasNotText
String
Filters elements that DO NOT contain the specified text anywhere in their DOM subtree.
The match is case-insensitive. Can be a string or a regular expression pattern.
Example: hasNotText: "spam" or hasNotText: "/advertisement/i"
hasText
String
Filters elements that contain the specified text anywhere in their DOM subtree.
The match is case-insensitive. Can be a string or a regular expression pattern.
Example: hasText: "important" or hasText: "/urgent/i"