Skip to content

Instantly share code, notes, and snippets.

@jimmyhmiller
Created January 30, 2020 20:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jimmyhmiller/e9e710bce6ee60171560e1052ce49539 to your computer and use it in GitHub Desktop.
Save jimmyhmiller/e9e710bce6ee60171560e1052ce49539 to your computer and use it in GitHub Desktop.
(require '[meander.epsilon :as m])
(m/search
[:main
[:div {:class "cal-listitem"}
[:h1 "thing"]
[[:div {:class "cal_date_show"}
[:div {:class "cal_date_day"} "1"]
[:div {:class "cal_date_date"} "12-09-2019"]
[:div {:class "cal_date_time"} "400 pm"]
[:div {:class "calinfo"} "Stuff here1"]]
[:div {:class "cal_date_show"}
[:div {:class "cal_date_day"} "1"]
[:div {:class "cal_date_date"} "12-09-2019"]
[:div {:class "cal_date_time"} "400 pm"]
[:div {:class "calinfo"} "Stuff here2"]]]
[:div {:class "listinfo"}
[:div {:class "thetitles"} "stuff"]
[:div {:class "thetitles"} "thing"]
[:div {:class "thetitles"} "more things"]]
[:div "Thing after"]]]
(m/$ [:main
. _ ...
(m/$ [_ {:class "cal-listitem"}
. _ ...
(m/scan [_ {:class "cal_date_show"}
_
[_ {:class "cal_date_date"} ?date]
[_ {:class "cal_date_time"} ?time]
[_ {:class "calinfo"} ?info]
& _])
. _ ...
(m/$ [_ {:class "listinfo"}
. _ ...
[_ {:class "thetitles"} ?titles]
& _])
& _])
& _])
[?date ?time ?info ?titles])
;; this returns
;; =>
(["12-09-2019" "400 pm" "Stuff here1" "stuff"]
["12-09-2019" "400 pm" "Stuff here1" "thing"]
["12-09-2019" "400 pm" "Stuff here1" "more things"]
["12-09-2019" "400 pm" "Stuff here2" "stuff"]
["12-09-2019" "400 pm" "Stuff here2" "thing"]
["12-09-2019" "400 pm" "Stuff here2" "more things"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment