Juha-Matti Santala
Community Builder. Dreamer. Adventurer.

I’m building a Python script to create form filling bookmarklets

In 2024 I wrote about how I like to create bookmarklets to help me fill in forms on apps and sites I develop. It’s not uncommon to have a dozen or even two fields in a form and filling them up over and over again by hand while developing gets boring real fast.

In that 2024 blog post, I mention

Not only is it boring but that boredom can lead to us entering silly or funny entries that can sometimes accidentally leak during demos or screenshots or database dumps and lead to negative outcomes.

Until now, I’ve been doing them by hand but this week I wanted to explore this problem space a bit more. I figured a nicer interface would be to have a spec file (in my case, written in YAML) where I could define all my fields and values and then run a script to generate the bookmarklet.

I wrote the first version of form-filler to satisfy my own needs. It’s an open source Python script and if you’re interested in simplifying a rather boring aspect of your web dev work, check it out.

Each bookmarklet represents a single use case and is defined in a YAML specification file as the example:

inputs:
  name:
    type: text
    value: "Jane Doe"
    selector: "#name"
  age:
    type: text
    value: 23
    selector: "#age"
  confirmation:
    type: checkbox
    value: false
    selector: "#confirmation"
  date:
    type: date
    value: "2026-05-25"
    selector: "#date"

Running the script with this example specification will generate a bookmarklet that when run, will fill in the given form with the values provided.

I tend to create a bookmark folder per form and create a bunch of bookmarklets to test different scenarios.


If something above resonated with you, let's start a discussion about it! Email me at juhamattisantala at gmail dot com and share your thoughts. This year, I want to have more deeper discussions with people from around the world and I'd love if you'd be part of that.