# screenshot

## Syntax

```python
py.screenshot(filename: str) -> None
```

## Usage

{% code title="correct usage" %}

```python
# saves the screenshot to the current working directory
py.screenshot("ss.png")

---or---

# saves the screenshot using the filepath
py.screenshot("../images/ss.png")
```

{% endcode %}

{% code title="incorrect usage" %}

```python
# Errors, include the file extension like '.png'
py.screenshot("ss")

---or---

# Errors, .screenshot() yields None
py.screenshot("ss.png").get("a")
```

{% endcode %}

## Arguments

* <mark style="color:purple;">`filename (str)`</mark> - The filename including the **path** to the directory you want to save it in

{% hint style="info" %}
Make sure to include the file extension like **.png**
{% endhint %}

## Yields

* None


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.pylenium.io/driver-commands/browser/screenshot.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
