Here is a first version of a script/program to scrape the MAME ROW pages and to create a database out of it. It reads each page and tries to get the game information, including the romname. It generates a .json file which can be used in a variety of other ways. Also a .txt file is created alongside it too, which contains all roms and bios files. If input and output file are set to same (default), then only new games will be added. Unfortunately the script still downloads each page to analyze it.
The script in Python format is itself very rough and not finished, no comments. I may eventually work on it. Game page 1 and 52 are not formatted like the other pages and therefore missing the game data. Game page 139 is the only one not using a relative url. All in all, I had fun creating this and it is a proof of concept.
You don't need to use the script, if you are interested in the database files. Just download the files instead.