MiniWoB++ v0.1 Release: Legacy code for reproducibility
MiniWoB++ (Mini World of Bits++) contains a collection of over 100 web interaction environments, ranging from simple button clicks to more complex forms and web apps. The benchmark was originally designed for reinforcement learning. The environments are self-contained and have a unified interface (similar to Atari environments). On the other hand, they pose several challenges such as sparse rewards, long episode horizons, and multimodal states.
This legacy release contains the original version of the code as released with the paper (Liu et al., 2018) Reinforcement Learning on Web Interfaces using Workflow-Guided Exploration, which implements a Selenium-based Python interface for interacting with the environment.
While we are excited to bring standardization with the Gymnasium API, action space customization, and other new features to MiniWoB++, the updated Python interface becomes incompatible with older projects. This release allows such projects to be reproduced. New projects are encouraged to use the standardized Gymnasium interface.
Note that the environments themselves (HTML, CSS, and JavaScript files) have remained mostly the same since the initial release. Older projects that only use the environments can use the latest version of the code as well.
The next stable release (v1) will support Python 3.6+ and have full integration with the Gymnasium API.
Requirements
The code was tested on Python 2.7. Other requirements are listed in python/requirements.txt
. Follow the instructions in python/README.md
to set up the code.
Example code usage
The code below performs a deterministic action on the click-test-2
environment (Instruction: “Click button ONE.”). The equivalent code for the new Gymnasium interface is here.
import os
import time
from miniwob.action import MiniWoBElementClick
from miniwob.environment import MiniWoBEnvironment
env = MiniWoBEnvironment('click-test-2')
# Wrap the code in try-finally to ensure proper cleanup.
try:
base_url = os.environ.get('MINIWOB_BASE_URL')
env.configure(base_url=base_url, headless=False, seeds=[123])
# Start a new episode.
states = env.reset()
time.sleep(2) # Only here to let you look at the environment.
# Find the HTML element with text "ONE".
for element in states[0].dom_elements:
if element.text == "ONE":
break
# Click on the element.
actions = [MiniWoBElementClick(element)]
states, rewards, dones, info = env.step(actions)
# Check if the action was correct.
assert rewards[0] >= 0 # Should be around 0.8 since 2 seconds have passed.
assert dones[0] is True
time.sleep(2)
finally:
env.close()
For more code usage, check out the following projects: