Skip to content

Commit

Permalink
doc improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
jackrusher committed Sep 20, 2017
1 parent de84f53 commit fc039cd
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -17,6 +17,11 @@ dependencies. I've found it to be a nice basis for testing web
applications, scraping content from Javascript-heavy websites,
automating interactions with services, and so on.

**N.B.** While Oracle's JVM bundles JavaFX, the OpenJDK JVM does not
come with it. If you're using OpenJDK (which is the default on
_ubuntu_, for example), you must also install the OpenJFX package on
your chosen platform in order to use this library.

## Quick Start

``` clojure
Expand Down
17 changes: 17 additions & 0 deletions doc/intro.md
Expand Up @@ -35,3 +35,20 @@ retrieves the text of one:
text))
;;=> "I hope you find Clojure's combination of facilities elegant, powerful, practical and fun to use."
```

### Laziness and resource management

Note that we cannot return a lazy collection of elements from inside
the `with-browser` macro, as the underlying browser will no longer
exist by the time the collection is realized. So, for example, if we
were to modify the above example to look like this:

``` clojure
(with-browser [browser (make-browser)]
(-> (fetch! browser "http://clojure.org")
(find-by-xpath* "//div[@class='clj-intro-message']/p")))
;;=> "I hope you find Clojure's combination of facilities elegant, powerful, practical and fun to use."
```

The elements returned by `find-by-xpath` would be inaccessible outside
of the `with-browser` macro.

0 comments on commit fc039cd

Please sign in to comment.