【发布时间】:2013-10-04 17:03:04
【问题描述】:
我刚开始使用 Clojure,从未使用过 Java
我了解如何从终端创建和运行一个 leiningen 项目,但我不明白如何在运行命令之前在 REPL 中加载库。
我正在尝试使用 clj-webdriver 构建一个简单的网络抓取工具;我的原始文件是这样的
(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 文件夹并尝试此命令
penta@laptop:~/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。一个很酷的 leiningen 插件。
标签: clojure read-eval-print-loop