rcackerman / parole-hearing-data

http://www.parolehearingdata.org/
21 stars 12 forks source link

Almost all exceptions during parsing are caught & ignored #23

Closed talos closed 9 years ago

talos commented 9 years ago

Ideally, we shouldn't use a general except, as it could hide errors that we need to fix. What exception is raised when there is a missing detail page or no results (https://github.com/rcackerman/parole-hearing-data/blob/master/scrape.py#L99 and https://github.com/rcackerman/parole-hearing-data/blob/master/scrape.py#L142)?

rcackerman commented 9 years ago

Sorry, I'm not sure I understand what you're trying to get from this issue. Are you asking why we put in the except clauses?

talos commented 9 years ago

I submitted this issue before I delved deeper into the code and realized that the excepts were catching AttributeErrors from when a method was called on a None from BeautifulSoup's find... I was asking what the except clauses were actually catching. However, I think if we make sure that elements are not None we don't need them anyway.

tl;dr: I answered my own question. Closing. :)