我刚开始使用Clojure和从未使用过的JavaClojure的:使用库函数从REPL
我明白了如何创建和运行从终端leiningen项目,但我不明白如何加载图书馆REPL在运行命令之前。
我试图用clj-webdriver建立一个简单的web scrapler;我原来的文件看起来像这样
(ns prova.core (:gen-class))
(use 'clj-webdriver.taxi)
(set-driver! {:browser :firefox})
(defn -main
[& args]
(to "https://github.com/login")
(input-text "#login_field" "email")
(input-text "#password" "psw")
(click "input[name='commit']")
)
我(觉得)最近已经得到实现它打算进入webdriver的src文件夹,并尝试这个命令
[email protected]:~/clj-webdriver-master/src/clj_webdriver$ clojure
Clojure 1.4.0
user=> (use 'taxi)
但它返回
FileNotFoundException Could not locate taxi__init.class or taxi.clj on classpath: clojure.lang.RT.load (RT.java:432)
即使你在同一个文件夹中taxy.clj文件确实存在。
那么,运行可以使用库函数的REPL的过程是什么?
非常感谢
就像一个笔记,如果你只想尝试一个库而不创建一个项目,你可以使用[lein-try](https://github.com/rkneufeld/lein-try)。一个非常酷的leiningen插件。 – izaban