Repository: openstates/openstates-scrapers

Issue:
HI-scrape failing since at least 2019-12-25T05:01:07.752900
HI-scrape has failed 5 times since 2019-12-25T05:01:07.752900

Logs:
```
Traceback (most recent call last):
  File "/root/.cache/pypoetry/virtualenvs/**BACKUPS/PGUSER**-vRcYrsYN-py3.7/bin/pupa", line 11, in <module>
    load_entry_point('pupa==0.10.0', 'console_scripts', 'pupa')()
  File "/root/.cache/pypoetry/virtualenvs/**BACKUPS/PGUSER**-vRcYrsYN-py3.7/lib/python3.7/site-packages/pupa/cli/__main__.py", line 68, in main
    subcommands[args.subcommand].handle(args, other)
  File "/root/.cache/pypoetry/virtualenvs/**BACKUPS/PGUSER**-vRcYrsYN-py3.7/lib/python3.7/site-packages/pupa/cli/commands/update.py", line 278, in handle
    return self.do_handle(args, other, juris)
  File "/root/.cache/pypoetry/virtualenvs/**BACKUPS/PGUSER**-vRcYrsYN-py3.7/lib/python3.7/site-packages/pupa/cli/commands/update.py", line 327, in do_handle
    report['scrape'] = self.do_scrape(juris, args, scrapers)
  File "/root/.cache/pypoetry/virtualenvs/**BACKUPS/PGUSER**-vRcYrsYN-py3.7/lib/python3.7/site-packages/pupa/cli/commands/update.py", line 175, in do_scrape
    report[scraper_name] = scraper.do_scrape(**scrape_args)
  File "/root/.cache/pypoetry/virtualenvs/**BACKUPS/PGUSER**-vRcYrsYN-py3.7/lib/python3.7/site-packages/pupa/scrape/base.py", line 112, in do_scrape
    for obj in self.scrape(**kwargs) or []:
  File "/opt/**BACKUPS/PGUSER**/**BACKUPS/PGUSER**/**BACKUPS/PGUSER**/hi/bills.py", line 287, in scrape
    yield from self.scrape_type(chamber, session, typ)
  File "/opt/**BACKUPS/PGUSER**/**BACKUPS/PGUSER**/**BACKUPS/PGUSER**/hi/bills.py", line 276, in scrape_type
    yield from self.scrape_bill(session, chamber, billtype_map, bill_url)
  File "/opt/**BACKUPS/PGUSER**/**BACKUPS/PGUSER**/**BACKUPS/PGUSER**/hi/bills.py", line 230, in scrape_bill
    )[-1]
IndexError: list index out of range
```
        


Discussion:

Resolving patch:
diff --git a/openstates/hi/bills.py b/openstates/hi/bills.py
--- a/openstates/hi/bills.py
+++ b/openstates/hi/bills.py
@@ -225,15 +225,18 @@ def scrape_bill(self, session, chamber, bill_type, url):
                 legislative_session=prior_session,
                 relation_type="companion",
             )
-        prior = bill_page.xpath(
+        if bill_page.xpath(
             "//table[@id='ContentPlaceHolderCol1_GridViewStatus']/tr/td/font/text()"
-        )[-1]
-        if "carried over" in prior.lower():
-            b.add_related_bill(
-                identifier=bill_id.replace(u"\xa0", " "),
-                legislative_session=prior_session,
-                relation_type="companion",
-            )
+        ):
+            prior = bill_page.xpath(
+                "//table[@id='ContentPlaceHolderCol1_GridViewStatus']/tr/td/font/text()"
+            )[-1]
+            if "carried over" in prior.lower():
+                b.add_related_bill(
+                    identifier=bill_id.replace(u"\xa0", " "),
+                    legislative_session=prior_session,
+                    relation_type="companion",
+                )
         for sponsor in meta["Introducer(s)"]:
             b.add_sponsorship(sponsor, "primary", "person", True)
         versions = self.parse_bill_versions_table(b, versions)


Test patch: