From 8ffc29eda55bccedff297f98db454d22f2dae9aa Mon Sep 17 00:00:00 2001 From: Max Shenfield Date: Tue, 14 Mar 2017 00:30:02 -0500 Subject: [PATCH] LA exclude "Total --" correctly This fixes the naming issue in la noted in #1397. --- openstates/la/bills.py | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/openstates/la/bills.py b/openstates/la/bills.py index fd00c06f49..558eaf4361 100644 --- a/openstates/la/bills.py +++ b/openstates/la/bills.py @@ -150,7 +150,6 @@ def scrape_vote(self, bill, name, url): os.remove(temp_path) vote_type = None - total_re = re.compile('^Total--(\d+)$') body = html.xpath('string(/html/body)') date_match = re.search('Date: (\d{1,2}/\d{1,2}/\d{4})', body) @@ -164,7 +163,8 @@ def scrape_vote(self, bill, name, url): for line in body.replace(u'\xa0', '\n').split('\n'): line = line.replace(' ', '').strip() - if not line: + # Skip blank lines and "Total --" + if not line or 'Total --' in line: continue if line in ('YEAS', 'NAYS', 'ABSENT'): @@ -173,10 +173,7 @@ def scrape_vote(self, bill, name, url): elif line in ('Total', '--'): vote_type = None elif vote_type: - match = total_re.match(line) - if match: - vote['%s_count' % vote_type] = int(match.group(1)) - elif vote_type == 'yes': + if vote_type == 'yes': vote.yes(line) elif vote_type == 'no': vote.no(line)