LLM-powered web automation library with autonomous agents
Project description
webtask
Easy-to-use LLM-powered web automation.
Installation
pip install pywebtask
playwright install chromium
Quick Start
from webtask import Webtask
from webtask.integrations.llm import GeminiComputerUse
wt = Webtask()
agent = await wt.create_agent(llm=GeminiComputerUse(), mode="visual")
await agent.do("Go to practicesoftwaretesting.com and add 2 Flat-Head Wood Screws to the cart")
verdict = await agent.verify("the cart contains 2 items")
if verdict:
print("Success!")
Features
Simple or complex tasks
await agent.do("Click the login button") # Single action
await agent.do("Find the blue shirt, add to cart, and checkout") # Multi-step task
Stateful agents
# Agent remembers context across tasks
await agent.do("Add 2 wood screws to cart")
await agent.do("Add 5 cross-head screws")
await agent.do("Go to cart and verify")
Three modes
agent = await wt.create_agent(llm=llm, mode="text") # DOM-based (default)
agent = await wt.create_agent(llm=llm, mode="visual") # Screenshots
agent = await wt.create_agent(llm=llm, mode="full") # Both
Verification
verdict = await agent.verify("the cart contains 7 items")
if verdict:
print("Success!")
Data extraction
class ProductInfo(BaseModel):
name: str
price: float
product = await agent.extract("product information", ProductInfo)
Error handling
try:
await agent.do("Add item to cart")
except TaskAbortedError as e:
print(f"Task failed: {e}")
Easy integration
agent = await wt.create_agent(llm=llm) # New browser
agent = await wt.create_agent_with_browser(llm=llm, browser=browser) # Existing browser
agent = wt.create_agent_with_context(llm=llm, context=context) # Existing context
agent = wt.create_agent_with_page(llm=llm, page=page) # Existing page
Supported LLMs
from webtask.integrations.llm import Gemini, GeminiComputerUse, Bedrock
Gemini(model="gemini-2.5-flash") # 2.5 Flash
GeminiComputerUse(model="gemini-2.5-computer-use-preview") # Visual mode
Bedrock(model="anthropic.claude-sonnet-4-20250514-v1:0") # Claude 4 Sonnet (WIP)
TODO
- Unlimited context - Compact conversation history for extended sessions
- Mind2Web benchmark - Evaluation on Mind2Web dataset
Links
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pywebtask-0.21.0.tar.gz.
File metadata
- Download URL: pywebtask-0.21.0.tar.gz
- Upload date:
- Size: 72.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2ae46eebb5a32d2266169ff6201ece275a66d9678161770f81819257233383dc
|
|
| MD5 |
178d2b0d789e6f2945c440de98ffbad3
|
|
| BLAKE2b-256 |
2a4f004a0dde6baecfa596c75f320061e29166277279087e4a45087af0d51733
|
Provenance
The following attestation bundles were made for pywebtask-0.21.0.tar.gz:
Publisher:
publish.yml on steve-z-wang/webtask
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pywebtask-0.21.0.tar.gz -
Subject digest:
2ae46eebb5a32d2266169ff6201ece275a66d9678161770f81819257233383dc - Sigstore transparency entry: 737505358
- Sigstore integration time:
-
Permalink:
steve-z-wang/webtask@996e67f287487c280cfd6413466e64067b0a6441 -
Branch / Tag:
refs/tags/v0.21.0 - Owner: https://github.com/steve-z-wang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@996e67f287487c280cfd6413466e64067b0a6441 -
Trigger Event:
release
-
Statement type:
File details
Details for the file pywebtask-0.21.0-py3-none-any.whl.
File metadata
- Download URL: pywebtask-0.21.0-py3-none-any.whl
- Upload date:
- Size: 107.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a20f0853af6e8e5366ce6ec2141700f2fec13f201409b0138341a908e00f3514
|
|
| MD5 |
1230a8b0ed105bfa07a0c9fe9eee2f3c
|
|
| BLAKE2b-256 |
b40ced093fef2fc2b28c230a9f366dc63646b7646222a47a1df5da5a3e8872bd
|
Provenance
The following attestation bundles were made for pywebtask-0.21.0-py3-none-any.whl:
Publisher:
publish.yml on steve-z-wang/webtask
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pywebtask-0.21.0-py3-none-any.whl -
Subject digest:
a20f0853af6e8e5366ce6ec2141700f2fec13f201409b0138341a908e00f3514 - Sigstore transparency entry: 737505360
- Sigstore integration time:
-
Permalink:
steve-z-wang/webtask@996e67f287487c280cfd6413466e64067b0a6441 -
Branch / Tag:
refs/tags/v0.21.0 - Owner: https://github.com/steve-z-wang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@996e67f287487c280cfd6413466e64067b0a6441 -
Trigger Event:
release
-
Statement type: