BrowserGym: a gym environment for web task automation in the Chromium browser
Project description
BrowserGym
This package provides browsergym
, a gym environment for web task automation in the Chromium browser.
Setup
- Install the package
pip install browsergym
- Install playwright browsers
playwright install
- For each benchmark, specific setup instructions must be followed
- for miniwob, see miniwob/README.md
- for webarena, see webarena/README.md
- for workarena, see the WorkArena repository
Usage
Open-ended task example
Boilerplate code to run an agent on the openended task:
import gymnasium as gym
import browsergym.core # register openended taskj as a gym environment
env = gym.make(
"browsergym/openended", start_url="https://www.google.com/", wait_for_user_message=True
)
obs, info = env.reset()
done = False
while not done:
action = ... # implement your agent here
obs, reward, terminated, truncated, info = env.step(action)
MiniWoB++ task example
Boilerplate code to run an agent on a miniwob task:
import gymnasium as gym
import browsergym.miniwob # register miniwob tasks as gym environments
env = gym.make("browsergym/miniwob.choose-list")
obs, info = env.reset()
done = False
while not done:
action = ... # implement your agent here
obs, reward, terminated, truncated, info = env.step(action)
WebArena task example
Boilerplate code to run an agent on a webarena task:
import gymnasium as gym
import browsergym.webarena # register webarena tasks as gym environments
env = gym.make("browsergym/webarena.310")
obs, info = env.reset()
done = False
while not done:
action = ... # implement your agent here
obs, reward, terminated, truncated, info = env.step(action)
WorkArena task example
Boilerplate code to run an agent on a workarena task:
import gymnasium as gym
import browsergym.workarena # register workarena tasks as gym environments
env = gym.make("browsergym/workarena.servicenow.order-ipad-pro")
obs, info = env.reset()
done = False
while not done:
action = ... # implement your agent here
obs, reward, terminated, truncated, info = env.step(action)
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
browsergym-0.0.1a10.tar.gz
(2.7 kB
view details)
Built Distribution
File details
Details for the file browsergym-0.0.1a10.tar.gz
.
File metadata
- Download URL: browsergym-0.0.1a10.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18f1588e41f0e1dd9194db17a1663d4eeb04298e4fa7d64ffd9e66d5852d0b91 |
|
MD5 | adb2d0789b20aad8088aeb52a5a5cc58 |
|
BLAKE2b-256 | e895a1dd1f7bf14f15b667f1fc6d0a448842c537f5b5f09f1e576bf287cb6aa7 |
File details
Details for the file browsergym-0.0.1a10-py3-none-any.whl
.
File metadata
- Download URL: browsergym-0.0.1a10-py3-none-any.whl
- Upload date:
- Size: 2.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/5.0.0 CPython/3.12.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 03c88ed3cdcbca78f23ba19899d41785feae77981f7ede6eddca7158060934e7 |
|
MD5 | 5d0cc7e23ca84d7dd5359925b56db2bf |
|
BLAKE2b-256 | 4e5584af035be0be3ecaf60f2d26006560cf7e68bd2d869726e79a4c49f6915f |