Refactor generalised `parse_html_table` function from capecommute