Skip to content

Instantly share code, notes, and snippets.

@duanebester
Last active October 28, 2021 19:58
Show Gist options
  • Save duanebester/49c43a6228efebfe407090e6a6d2fdcd to your computer and use it in GitHub Desktop.
Save duanebester/49c43a6228efebfe407090e6a6d2fdcd to your computer and use it in GitHub Desktop.
Web Scraping w/ Clojure adding product links to cache
(clear-site "bellroy") ;; Clear cache first
(find-products "bellroy" "https://bellroy.com/sitemap.xml" product->cache)
(get-count "bellroy")
;; => 158
;; Popping product links example:
(cache->product "bellroy")
;; => {:loc "https://bellroy.com/products/pod-jacket", ...}
(cache->product "bellroy")
;; => {:loc "https://bellroy.com/products/phone-case-3-card/leather_iphone_se", ...}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment