Skip to content

Instantly share code, notes, and snippets.

@k0f1sh
Created February 23, 2016 11:25
Show Gist options
  • Save k0f1sh/64d300f8b448ad6a289e to your computer and use it in GitHub Desktop.
Save k0f1sh/64d300f8b448ad6a289e to your computer and use it in GitHub Desktop.
clj-driverでphantomを動かす最小
;; project.clj
(defproject hogehoge "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:dependencies [[org.clojure/clojure "1.7.0"]
[clj-webdriver "0.7.2"]
[com.codeborne/phantomjsdriver "1.2.1"
:exclusion [org.seleniumhq.selenium/selenium-java
org.seleniumhq.selenium/selenium-server
org.seleniumhq.selenium/selenium-remote-driver]]
[org.seleniumhq.selenium/selenium-java "2.52.0"]])
;; core.clj
(ns cljphantom.core
(:require [clj-webdriver.core :as c]
[clj-webdriver.taxi :as t]))
(t/set-driver! (c/new-driver {:browser :phantomjs}))
(t/window-resize {:width 970 :height 800})
(t/to "https://www.google.co.jp/")
(c/get-screenshot t/*driver*)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment