Two weeks ago, I did a little bit of web scraping, getting data from a simple table. Last week, I created a baseball simulator in JavaScript. This week, I’m combining the two: scraping data from a baseball stats site, then building a simulator… but this time, both in Python!

Scraping The Data

Whereas in JavaScript we used the request().then().then() …


Are we in a simulation? Perhaps. If you don’t believe me, well, I’m the one who is simulating your reality. I specifically programmed you to be skeptical of this premise, therefore, your skepticism is actually proof that I’m right. Ha! Got you! Don’t try to fight it. I already know what’s going to happen. Embrace the determinism!

Okay… moving on to the article itself, I recall that one day, three or so years ago, I decided to try to whip up a baseball simulator. I was inspired by Win Expectancy Finder, the wonderful site created by Greg Stoll, which holds a database of every single regular season MLB at bat since 1957 (currently 130,860 games!) …


Sometimes I see a table of data on a website and wonder “How is that information stored?” The data itself, of course, is situated within whatever database the website’s owner is using. However, the data is rendered on the page in simple HTML, and as it turns out, collecting and manipulating that data is pretty darn easy! All we need is our friend, the DOM.

The DOM

DOM means “Document-Object Model”. Basically, an HTML page is an object, with elements that are also objects that can contain “child” objects, as well as belong to other objects. …


One of the bright sides of computers is that they do precisely as they are told. Scripts execute in a completely predictable fashion, with no possibility of misinterpretation by the computer. Any errors, stack overflows and infinite loops are the result of the fallible humans and the error-filled code they compose. For computers, unlike humans, “I was only following orders!” is a wholly acceptable excuse.

The trouble, then, is how to communicate with them. The answer, of course, is: via programming languages. There are hundreds of different computer languages, of different syntactic “levels”. A “high level” programming language is one whose syntax is more “similar” to human languages. …


One of the best ways to understand an idea is to attempt to explain it to someone else. The process of breaking a concept down and presenting it in a simple fashion is a great way to delve into the details and improve one’s own understanding. As the Internet pretends Albert Einstein said: “If you can’t explain it simply you don’t understand it well enough”. If I’m not mistaken, Abraham Lincoln is the true originator of this fake quote, but regardless of its genesis, it’s a solid rule of thumb! This is how I feel about pointers, a vital computer science concept well familiar to anyone who has programmed in core object-oriented languages like C or C++. …


Programming languages, due to the speed of modern computing power, execute commands very quickly. This is wonderful for processing large amounts of data, but less so for human interface purposes. If you want something to appear on a screen long enough for a user to process it, yet the computer runs through the code in 0.00001 seconds, well, you’re SOL, as very few people have the capacity to handle information at that rate. What we need is a way to ensure that the computer, upon printing something, takes a brief pause, to allow the viewer to take it all in.

For many languages, this is as simple as, in effect, putting a “pause” command within the code, with the pause time expressed in milliseconds. …


Programmers, just like all subcultures, have characteristics, some of which have been distilled via witticisms and aphorisms:

“A programmer is an organism that converts caffeine into code”

“There are no good programmers- only experienced ones”

“The best programmers are lazy and act dumb”

This last one really hits home. Why do in five lines what can be done in two? Or in one long line that can be done in one slightly shorter line? …


14 days into this bootcamp, I’ve noticed a pattern so far in my skill acquisition, particularly with Active(W)Rec(k)ord…

0. Feel fairly comfortable in any given moment with the skills I possess

Jroverby92

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store