PythonでSeleniumのFirefox(WebDriver)を利用するのはすぐわかったのだけれど、HTMLUnitを利用する方法がすぐ見つからなかったのでメモ。 PythonでHTMLUnitを使うには、webdriver.Remoteを利用すれば良い。 1. PythonにSeleniumをインストール 2. Selenium RCをダウンロード 3. Selenium RCを起動 4. Pythonからwebdriver.Remoteを呼ぶ # coding: utf-8 from selenium import webdriver def main(): driver = webdriver.Remote( command_executor= 'http://127.0.0.1:4444/wd/hub', desired_capabilities={ 'browserName