Python error: NoneType object has no attribute find_all
The error means that the
table variable that you are building by doing:
table = BeautifulSoup(r.text).table
for row in table.find_all(tr)[1:]: on a
None is throwing the error.
You can check if the
url in question has a table in the way you are trying to access it. You can do this by printing out the
url constructed by this statement:
BASE_URL.format(row[prefix_1], year, row[prefix_2])
and then going to this url in your browser to check if it has the table of your interest.