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.7+ 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.create_action(ActionTypes.CLICK_ELEMENT, ref=element["ref"])
  obs, reward, terminated, truncated, info = env.step(action)

  # Check if the action was correct. 
  assert reward >= 0      # 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-0.0.1.tar.gz (1.5 MB view details)

Uploaded Source

Built Distribution

miniwob-0.0.1-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for miniwob-0.0.1.tar.gz
Algorithm Hash digest
SHA256 622afb64d7116934810eb389c5378ed450d53371ec609088840a0e560ce40107
MD5 6f47dd4c948f39bc6005f729fc082396
BLAKE2b-256 89e3c2261ea81270c0b2409f751693fdf28a1e56eba77d2bc845f4446ade61c4

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for miniwob-0.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 0a115df1143977614f67a1bf70d22c4e5a65d1572888467f277cf2ec4fb00789
MD5 3f7f735838a5abae7a2e2f133bc7ea29
BLAKE2b-256 2eb0cbd9deed34ae7361100a4bd224dc2b388f2ef3e7bd5c100de72c95f3f21c

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