PhantomJS 2 is a headless WebKit scriptable (browser) with a JavaScript API
5M+
Dockerfile linkslatest built from the latest PhantomJS snapshot 2, 2.1, 2.1.1 2.0, 2.0.0 1, 1.9, 1.9.7 PhantomJS is a headless WebKit browser, often used via WebDriver for web system testing. It's based on WebKit, runs JavaScript, and allows to take screenshots.
This Dockerized version of PhantomJS is:
52379 (selected randomly to avoid mapping to an existing user) and uses dumb-init to reap zombie processes.Start PhantomJS in REPL:
$ docker run -it --rm wernight/phantomjs
>
Start as 'Remote WebDriver mode' (embedded GhostDriver):
$ docker run -d -p 8910:8910 wernight/phantomjs phantomjs --webdriver=8910
To connect to it (some examples per language):
Java:
WebDriver driver = new RemoteWebDriver(
new URL("http://127.0.0.1:8910"),
DesiredCapabilities.phantomjs());
Python (after running $ pip install selenium):
from selenium import webdriver
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
driver = webdriver.Remote(
command_executor='http://127.0.0.1:8910',
desired_capabilities=DesiredCapabilities.PHANTOMJS)
driver.get('http://example.com')
driver.find_element_by_css_selector('a[title="hello"]').click()
driver.quit()
Improvement ideas and pull requests are welcome via Github Issue Tracker.
Content type
Image
Digest
sha256:cbffd33f7…
Size
58.6 MB
Last updated
almost 6 years ago
docker pull wernight/phantomjs