# Overview

## py

This is the main object in Pylenium. This is essentially the **Bot or Browser** you're controlling in your tests. Navigate to websites, take screenshots, find elements to click on or enter text, and much more!

{% code title="example" %}

```python
from pylenium.driver import Pylenium


def test_visit(py: Pylenium):
    py.visit("https://qap.dev")
```

{% endcode %}

## Element and Elements

These commands allow you to interact and perform actions against an [Element](/element-commands.md) or [Elements](/elements-commands.md).

{% code title="Chain commands" %}

```python
py.get("ul").find("li").first().click()
```

{% endcode %}

{% code title="or use variables" %}

```bash
# Click the first element with id=button
element = py.get("#button")
element.click()
```

{% endcode %}

{% code title="Mix and match variables and chains" %}

```python
# Print the href value of all links on the page
elements = py.find("a")
for el in elements:
    print(el.get_attribute("href"))
```

{% endcode %}

{% code title="Use what is best for you :)" %}

```python
# Check all checkboxes
py.find("input.checkbox").check()
```

{% endcode %}


---

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