r/gleamlang • u/Large-Scratch2804 • 23h ago
I built a scraping library for Gleam and used it to collect 77k govcon posts
scream is a Scrapling-inspired scraping library for Gleam. It gives you an htmgrrrl-backed DOM you can walk in every direction, CSS selectors, and a polite fetcher that backs off when a server says slow down. It's on hex and Tangled.
I wrote it up, then pointed it at Reddit's archive, HN, and Bluesky to collect 77,948 posts about government contracting. I also benchmarked it against Scrapling: it's 4–12× slower, mostly because of how I build the node table. It's pre-1.0 at the moment since it's not very good at the moment, but I'm going to continue using it regardless.
If you know a faster way to build a big tree on the BEAM, I'd love to hear it. I'm going to continue working on getting it to 1.0, and I'm pretty excited since it's a tool I'll definitely use. I'm loving Gleam more and more all the time and have gotten to the point where I know it at a basic level. Never worked with a functional programming language like it before.
Check it out: https://www.gudetimes.com/blog/atproto-govcon-scream
As always, I appreciate the this community for showing me gleam! I wouldn't have found it without Reddit.