Skip to content

caseytlee/playwright-cljs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Browser Automation with ClojureScript

Run example

Develop

The Calva VS Code extension is widely used for Clojure(Script) development.

  • Calva's Jack-in command is useful for starting a development REPL.
  • Once a REPL has been started, interactive development can be done through Code Evaluation.

The following macro is quite helpful for REPL development:

(defmacro defp
    "Define var when promise is resolved"
    [binding expr]
    `(-> ~expr (.then (fn [val]
                        (def ~binding val)))))

You can use it like this:

(require '["playwright$default" :as pw])
(defp browser (.launch pw/chromium #js {:headless false}))
(defp context (.newContext browser))
(defp page (.newPage context))
(.goto page "https://weather.gov")

About

A small repo for demonstrating the capability to perform browser automation with ClojureScript and Playwright.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors