Or if I'd just used R correctly. The code surely isn't best practice in R, just kind of hashed together.
I had actually started doing this in Python, but my limited knowledge of Python meant I was resorting to two different libraries to scrape the two data tables.