Repository: openstates/openstates-scrapers

Issue:
LA failing since at least 2018-04-05
LA has been failing since 2018-04-05

Based on automated runs it appears that LA has not run successfully in 2 days (2018-04-05).


```
  01:05:05 INFO scrapelib: GET - http://house.louisiana.gov/H_Reps/members.aspx?ID=49
01:05:07 INFO pupa: save person Blake Miguez as person_74dd4a9e-3960-11e8-ad12-020cc24ae92a.json
01:05:07 INFO pupa: save membership 74dd4a9e-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "lower"} as membership_74dd4f3a-3960-11e8-ad12-020cc24ae92a.json
01:05:07 INFO pupa: save membership 74dd4a9e-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "party", "name": "Republican"} as membership_74dd5296-3960-11e8-ad12-020cc24ae92a.json
01:05:07 INFO scrapelib: GET - http://house.louisiana.gov/H_Reps/members.aspx?ID=40
01:05:09 INFO pupa: save person Dustin Miller as person_75e398f8-3960-11e8-ad12-020cc24ae92a.json
01:05:09 INFO pupa: save membership 75e398f8-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "lower"} as membership_75e39d8a-3960-11e8-ad12-020cc24ae92a.json
01:05:09 INFO pupa: save membership 75e398f8-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "party", "name": "Democratic"} as membership_75e39ff6-3960-11e8-ad12-020cc24ae92a.json
01:05:09 INFO scrapelib: GET - http://house.louisiana.gov/H_Reps/members.aspx?ID=56
01:05:10 INFO pupa: save person Gregory A. Miller as person_76f11aea-3960-11e8-ad12-020cc24ae92a.json
01:05:10 INFO pupa: save membership 76f11aea-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "lower"} as membership_76f11f86-3960-11e8-ad12-020cc24ae92a.json
01:05:10 INFO pupa: save membership 76f11aea-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "party", "name": "Republican"} as membership_76f121e8-3960-11e8-ad12-020cc24ae92a.json
01:05:10 INFO scrapelib: GET - http://house.louisiana.gov/H_Reps/members.aspx?ID=93
01:05:12 INFO pupa: save person Helena N. Moreno as person_77f9a1dc-3960-11e8-ad12-020cc24ae92a.json
01:05:12 INFO pupa: save membership 77f9a1dc-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "lower"} as membership_77f9a650-3960-11e8-ad12-020cc24ae92a.json
01:05:12 INFO pupa: save membership 77f9a1dc-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "party", "name": "Democratic"} as membership_77f9a8a8-3960-11e8-ad12-020cc24ae92a.json
01:05:12 INFO scrapelib: GET - http://house.louisiana.gov/H_Reps/members.aspx?ID=1
01:05:14 INFO pupa: save person James H. "Jim" Morris as person_79023e68-3960-11e8-ad12-020cc24ae92a.json
01:05:14 INFO pupa: save membership 79023e68-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "lower"} as membership_790242e6-3960-11e8-ad12-020cc24ae92a.json
01:05:14 INFO pupa: save membership 79023e68-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "party", "name": "Republican"} as membership_79024534-3960-11e8-ad12-020cc24ae92a.json
01:05:14 INFO scrapelib: GET - http://house.louisiana.gov/H_Reps/members.aspx?ID=14
01:05:16 INFO pupa: save person John C. "Jay" Morris, III as person_7a27bab6-3960-11e8-ad12-020cc24ae92a.json
01:05:16 INFO pupa: save membership 7a27bab6-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "lower"} as membership_7a27bf34-3960-11e8-ad12-020cc24ae92a.json
01:05:16 INFO pupa: save membership 7a27bab6-3960-11e8-ad12-020cc24ae92a membership in ~{"classification": "party", "name": "Republican"} as membership_7a27c1a0-3960-11e8-ad12-020cc24ae92a.json
01:05:16 INFO scrapelib: GET - http://house.louisiana.gov/H_Reps/members.aspx?ID=86
loaded Open States pupa settings...
la (scrape, import)
  people: {}
  committees: {}
  bills: {}
Traceback (most recent call last):
  File "/opt/openstates/venv-pupa//bin/pupa", line 11, in <module>
    load_entry_point('pupa', 'console_scripts', 'pupa')()
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/__main__.py", line 68, in main
    subcommands[args.subcommand].handle(args, other)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 260, in handle
    return self.do_handle(args, other, juris)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 305, in do_handle
    report['scrape'] = self.do_scrape(juris, args, scrapers)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/cli/commands/update.py", line 173, in do_scrape
    report[scraper_name] = scraper.do_scrape(**scrape_args)
  File "/opt/openstates/venv-pupa/src/pupa/pupa/scrape/base.py", line 111, in do_scrape
    for obj in self.scrape(**kwargs) or []:
  File "/opt/openstates/openstates/openstates/la/people.py", line 11, in scrape
    yield from getattr(self, 'scrape_' + chamber)(chamber)
  File "/opt/openstates/openstates/openstates/la/people.py", line 167, in scrape_lower
    yield from self.scrape_lower_legislator(hrp, info)
  File "/opt/openstates/openstates/openstates/la/people.py", line 122, in scrape_lower_legislator
    )[0].strip()
IndexError: list index out of range
```

Visit http://bobsled.openstates.org for more info.



Discussion:
looking into it.

Resolving patch:
diff --git a/openstates/la/people.py b/openstates/la/people.py
--- a/openstates/la/people.py
+++ b/openstates/la/people.py
@@ -117,10 +117,12 @@ def scrape_lower_legislator(self, url, leg_info):
             '//span[@id="body_FormView5_PARTYAFFILIATIONLabel"]/text()'
             )[0].strip()
         party = party_flags[party_info]
-        email = page.xpath(
-            '//span[@id="body_FormView6_EMAILADDRESSPUBLICLabel"]/text()'
-            )[0].strip()
-
+        try:
+            email = page.xpath(
+                '//span[@id="body_FormView6_EMAILADDRESSPUBLICLabel"]/text()'
+                )[0].strip()
+        except IndexError:
+            email = None
         district = leg_info['dist'].replace('Dist', '').strip()
 
         person = Person(name=name,


Test patch: