> ## 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.

# ElementFilterOptions

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.

## Definition

```graphql theme={null}
input ElementFilterOptions {
  has: ElementOptions
  hasNot: ElementOptions
  hasNotText: String
  hasText: String
  visible: Boolean
}
```

## Fields

### `has`

[ElementOptions](/reference/graphql/inputs/element-options)

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](/reference/graphql/inputs/element-options)

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](/reference/graphql/scalars/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](/reference/graphql/scalars/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"`

### `visible`

[Boolean](/reference/graphql/scalars/boolean)

Filters elements based on their visibility. If true, only currently visible elements are matched.
If false, only hidden elements are matched. If not specified, visibility is not checked.
Visibility is determined by factors like 'display: none', 'visibility: hidden', opacity, and element size.
