Skip to main content

A web interaction benchmark for reinforcement learning.

Project description

pre-commit Code style: black

The MiniWoB++ (Mini World of Bits++) library contains a collection of over 100 web interaction environments, along with JavaScript and Python interfaces for programmatically interacting with them. The Python interface follows the Gymnasium API and uses Selenium WebDriver to perform actions on the web browser.

MiniWoB++ is an extension of the OpenAI MiniWoB benchmark, and was introduced in the paper Reinforcement Learning on Web Interfaces using Workflow-Guided Exploration.

The documentation website is at miniwob.farama.org. Development on MiniWoB++ is currently ongoing to bring it up to Farama Standards for mature projects, and will be maintained long term after this point. See the Project Roadmap for more details. If you'd like to help out, you can join our discord server here: https://discord.gg/PfR7a79FpQ.

Installation

MiniWoB++ supports Python 3.8+ on Linux and macOS.

Installing the MiniWoB++ Library

To install the MiniWoB++ library, use pip install miniwob.

Installing Chrome/Chromium and ChromeDriver

We strongly recommend using Chrome or Chromium as the web browser, as other browsers may render the environments differently.

The MiniWoB++ Python interface uses Selenium, which interacts with the browser via the WebDriver API. Follow one of the instruction methods to install ChromeDriver. The simplest method is to download ChromeDriver with the matching version, unzip it, and then add the directory containing the chromedriver executable to the PATH environment variable:

export PATH=$PATH:/path/to/chromedriver

For Chromium, the driver may also be available in a software package; for example, in Debian/Ubuntu:

sudo apt install chromium-driver

Example Usage

The following code performs a deterministic action on the click-test-2 environment.

import time
import gymnasium
from miniwob.action import ActionTypes

env = gymnasium.make('miniwob/click-test-2-v1', render_mode='human')

# Wrap the code in try-finally to ensure proper cleanup.
try:
  # Start a new episode.
  obs, info = env.reset()
  assert obs["utterance"] == "Click button ONE."
  assert obs["fields"] == (("target", "ONE"),)
  time.sleep(2)       # Only here to let you look at the environment.
  
  # Find the HTML element with text "ONE".
  for element in obs["dom_elements"]:
    if element["text"] == "ONE":
      break

  # Click on the element.
  action = env.unwrapped.create_action(ActionTypes.CLICK_ELEMENT, ref=element["ref"])
  obs, reward, terminated, truncated, info = env.step(action)

  # Check if the action was correct. 
  print(reward)      # Should be around 0.8 since 2 seconds has passed.
  assert terminated is True
  time.sleep(2)

finally:
  env.close()

See the documentation for more information.

Environments

The list of the environments that were included in the MiniWoB++ library can be found in the documentation. All environments share the same observation space, while the action space can be configured during environment construction.

Citation

To cite this project please use:

@inproceedings{liu2018reinforcement,
 author = {Evan Zheran Liu and Kelvin Guu and Panupong Pasupat and Tianlin Shi and Percy Liang},
 title = {Reinforcement Learning on Web Interfaces using Workflow-Guided Exploration},
 booktitle = {International Conference on Learning Representations ({ICLR})},
 url = {https://arxiv.org/abs/1802.08802},
 year = {2018},
}

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

miniwob-1.0.tar.gz (1.6 MB view details)

Uploaded Source

Built Distribution

miniwob-1.0-py3-none-any.whl (1.9 MB view details)

Uploaded Python 3

File details

Details for the file miniwob-1.0.tar.gz.

File metadata

  • Download URL: miniwob-1.0.tar.gz
  • Upload date:
  • Size: 1.6 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for miniwob-1.0.tar.gz
Algorithm Hash digest
SHA256 4ea53c90d94b76ec0bd4cf6fa61ae2d70bd06c5cae7e9f0a0deaa0d5680e714b
MD5 0c39c05e0966af20e1f026f665452e5a
BLAKE2b-256 693f0d6b99f2c240823549e1fbe266d1dc9df87017271e3f5733f65839f0ec5e

See more details on using hashes here.

File details

Details for the file miniwob-1.0-py3-none-any.whl.

File metadata

  • Download URL: miniwob-1.0-py3-none-any.whl
  • Upload date:
  • Size: 1.9 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.4

File hashes

Hashes for miniwob-1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4b98466d863b2bc25d44acbcb719434c797b350b5e417b673766c1b6237f4704
MD5 3f5f113047baf3fb67cd4f4b51fe1443
BLAKE2b-256 7b87221ef054080a4f51c3fc19b0fa7388c429229e1a3ff50eb1dc7ce5e29991

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page