As a shameless plug, I created the
https://github.com/jbms/finance-dl package as a collection of my own tools for doing exactly this type of thing --- downloading data from various external sources, often via web scraping, so that it can be imported into beancount.
I've tried to provide a clean framework for configuring the data sources and running them, so that it is convenient to use.
While currently it only contains the sources I've created myself, I think we would all benefit from a common repository, as many of these sources are likely to be useful to multiple people (such as this patreon source).
The model in finance-dl is slightly different from what you have here, in that the existing data sources are designed to be fully automatic using the selenium webdriver Python package, and rather than directly outputting beancount transactions, the data sources generally try to save the raw data in as close to the original format as possible (e.g. CSV if the website provides an option for downloading in CSV format, or possibly a synthesized CSV based on data scraped from the website), and then a corresponding module in the beancount-import package is used to actually generate the transactions.