Okay, so I saw this “aaron judge race” thing trending and, like, I had to jump in. I’m no coding whiz, but I figured, how hard could it be to whip up something simple to track his home runs?

My Starting Point (aka Googling Like Crazy)
First things first, I needed data. Where do I even get real-time stats on Judge’s dingers? Turns out, there are some websites tracking MLB players. Took a bit of digging, I found one that looked promising, offering game-by-game logs.
Getting My Hands Dirty (and Confused)
Next, I needed to somehow pull this data. I’ve dabbled with Python before (mostly copy-pasting stuff from Stack Overflow), so I thought I’d give that a shot. There’s this library, called “Requests,” that supposedly helps you grab info from websites.
Installed that:
pip install requests
I muddled around for an embarrassing amount of time trying to figure out how to actually use it. Lots of tutorials, lots of errors. Eventually, I managed to get something printed to my screen, but it was a jumbled mess of HTML.
Wrangling the Data (aka More Googling)
So, I had this website’s code, but I needed to pick out just the home run numbers. That’s where “Beautiful Soup” comes in, another Python library. Another install:
pip install beautifulsoup4
This part was like, finding a needle in a haystack, but with code. I inspected the website’s source code (right-click, “Inspect Element” – felt like a hacker!), trying to find the pattern where the home run data lived. It was all nested in these <td> tags, inside <tr> tags…a whole hierarchy of stuff.

The “Aha!” Moment (Sort Of)
After a lot of trial and error (and more Stack Overflow), I finally figured out how to use Beautiful Soup to target those specific tags and pull out the numbers. It wasn’t pretty, but it worked! I had a Python script that could, in theory, get Judge’s home run count from that one game.
Putting It All Together (and Breaking It…Repeatedly)
Now, I wanted this to update automatically, right? So, I figured I’d set up a loop that would run the script, say, every hour. That’s where things got messy again. Dealing with dates, making sure I was getting the right game’s data…it was a headache.
I added some code to handle dates, figure out the current game, and then only grab the new home run data if it existed. But, It kept breaking, throwing errors, or just…not working.
The (Mostly) Working Result
Finally after I got something that mostly works. It’s not perfect, by any means. Sometimes it misses updates, sometimes it throws a random error. I also try to put them into a list:
- Date of game.
- Judge home run counts.
But, hey, it’s something. It’s a little Python script that I built, from scratch (well, with a lot of help from the internet), to track Aaron Judge’s home run chase. It’s a reminder that even seemingly simple projects can be a challenge, but also that it’s pretty cool to build something yourself, even if it’s a bit janky.