Playwright Browser Tool
This tool is a wrapper around the Playwright library. It allows you to navigate to a website, extract text and hyperlinks, and click on elements.
Warning Only support async functions and playwright browser APIs.
Installation
pip install llama-index-tools-playwright
Setup
In order to use this tool, you need to have a async Playwright browser instance. You can hook one up by running the following code:
browser = await PlaywrightToolSpec.create_async_playwright_browser(
headless=False
)
playwright_tool = PlaywrightToolSpec.from_async_browser(browser)
Usage
Navigate to a website
await playwright_tool.navigate_to("https://playwright.dev/python/docs/intro")
Navigate back
await playwright_tool.navigate_back()
Get current page URL
await playwright_tool.get_current_page()
Extract all hyperlinks
await playwright_tool.extract_hyperlinks()
Extract all text
await playwright_tool.extract_text()
Get element attributes
element = await playwright_tool.get_elements(
selector="ELEMENT_SELECTOR", attributes=["innerText"]
)
Click on an element
await playwright_tool.click(selector="ELEMENT_SELECTOR")
Fill in an input field
await playwright_tool.fill(selector="ELEMENT_SELECTOR", value="Hello")
Agentic Usage
This tool has a more extensive example usage documented in a Jupyter notebook here
Metadata
Release files for llama-index-tools-playwright 0.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| llama_index_tools_playwright-0.5.0.tar.gz | 5.9 kB | Without provenance | Details for llama_index_tools_playwright-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| llama_index_tools_playwright-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for llama_index_tools_playwright-0.5.0-py3-none-any.whl |
Total release size: 11.5 kB
Release files / llama_index_tools_playwright-0.5.0.tar.gz
| Download URL | llama_index_tools_playwright-0.5.0.tar.gz |
|---|---|
| Size | 5.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1fdb51df989f4429d0d8825a1fb498874696b4ada4071fe0a818147816acc570
|
|
BLAKE2b-256 checksum How to use checksums |
cc71d99775ad18f7ae17282ea1688bb557eadda50ebd766b07173953f00156db
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Release files / llama_index_tools_playwright-0.5.0-py3-none-any.whl
| Download URL | llama_index_tools_playwright-0.5.0-py3-none-any.whl |
|---|---|
| Size | 5.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
a1ca59a570d14a011ce263850ea3444c4cc327ffe78d9295fb55c157540a32b4
|
|
BLAKE2b-256 checksum How to use checksums |
33d2c50db369791e7b0b9f08a2e13bb0906ee542fbffee3edf4258ec4ac65cdb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.12.7 {"installer":{"name":"uv","version":"0.12.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
|
Security for llama-index-tools-playwright 0.5.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.