> ## Documentation Index
> Fetch the complete documentation index at: https://docs.scrapersensei.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Inspect Element

> Inspect Element in ScraperSensei

In ScraperSensei, you can inspect the element by clicking the "Inspect Element" button in the left of the input area.

Selector is helpful for locating the specific element you want to interact with.

![Inspect Element](https://mintlify.s3-us-west-1.amazonaws.com/scrapersensei/images/inspect-element.png)

You can fill any valid CSS selector or use the built-in selector tool to select the element.

We also provide some utility functions to help you get the selector of the element, as follows:

## .filter()

This method narrows existing locator according to the options, for example filters by text. It can be chained to filter multiple times.

```python
filter(has_text="text in column 1").filter(
    has=get_by_role("button", name="column 2 button")
)
```

Arguments:

* `has_text`: The text to filter by.
* `has_not_text`: The text to filter by.
* `has`: The element to filter by.
* `has_not`: The element to filter by.

## get\_by\_alt\_text

Allows locating elements by their alt text.

Usage

For example, this method will find the image by alt text "Playwright logo":

```html
<img alt="Playwright logo" />
```

```python
get_by_alt_text("Playwright logo")
```

## get\_by\_label

Allows locating input elements by the text of the associated `<label>` or aria-labelledby element, or by the aria-label attribute.

For example, this method will find inputs by label "Username" and "Password" in the following DOM:

```html
<input aria-label="Username">
<label for="password-input">Password:</label>
<input id="password-input">
```

Usage

```python
get_by_label("Username")
# or
get_by_label("Password")
```

## get\_by\_placeholder

Allows locating input elements by their placeholder attribute.

For example, consider the following DOM structure.

```html
<input type="email" placeholder="name@example.com" />
```

You can locate the input element by its placeholder:

```python
get_by_placeholder("name@example.com")
```

## get\_by\_role

Allows locating elements by their ARIA role, ARIA attributes and accessible name.

Usage

Consider the following DOM structure.

```html
<h3>Sign up</h3>
<label>
  <input type="checkbox" /> Subscribe
</label>
<br/>
<button>Submit</button>
```

You can locate each element by it's implicit role:

```python
get_by_role("heading", name="Sign up")
# or
get_by_role("checkbox", name="Subscribe")
# or
get_by_role("button", name="Submit")
```

## get\_by\_test\_id

Locate element by the test id.

Usage

Consider the following DOM structure.

```html
<button data-testid="directions">Itinéraire</button>
```

You can locate the button element by its test id:

```python
get_by_test_id("directions")
```

## get\_by\_text

Allows locating elements that contain given text.

See also [.filter()](/docs/essentials/inspect-element#filter) that allows to match by another criteria, like an accessible role, and then filter by the text content.

Usage

Consider the following DOM structure:

<div>Hello <span>world</span></div>
<div>Hello</div>

You can locate by text substring, exact string, or a regular expression:

```python
# Matches <span>
get_by_text("world")
# Matches first <div>
get_by_text("Hello")
# Matches second <div>
get_by_text("Hello")
# Matches both <div>s
get_by_text(re.compile("Hello"))
# Matches second <div>
get_by_text(re.compile("^hello$", re.IGNORECASE))
```

## get\_by\_title

Allows locating elements by their title or aria-label attribute.

Usage

Consider the following DOM structure.

```html
<span title="Issues count">25 issues</span>
```

You can check the issues count after locating it by the title text:

```python
get_by_title("Issues count")
```
