Repository: openstates/openstates-scrapers

Issue:
AZ failing since at least 2018-05-30
AZ has been failing since 2018-05-30

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


```
  02:06:33 INFO scrapelib: GET - https://apps.azleg.gov/api/Bill/?billNumber=SCM1003&sessionId=119&legislativeBody=S
02:06:34 INFO scrapelib: GET - https://apps.azleg.gov/api/DocType/?billStatusId=70406
02:06:36 INFO scrapelib: GET - https://apps.azleg.gov/api/BillSponsor/?id=70406
02:06:36 INFO scrapelib: GET - https://apps.azleg.gov/api/Keyword/?billStatusId=70406
02:06:37 INFO pupa: save bill SCM1003 in 53rd-2nd-regular as bill_277b1a76-64a1-11e8-a364-027506b8472c.json
02:06:37 INFO scrapelib: GET - https://apps.azleg.gov/api/Bill/?billNumber=SCM1004&sessionId=119&legislativeBody=S
02:06:38 INFO scrapelib: GET - https://apps.azleg.gov/api/DocType/?billStatusId=70434
02:06:40 INFO scrapelib: GET - https://apps.azleg.gov/api/BillSponsor/?id=70434
02:06:40 INFO scrapelib: GET - https://apps.azleg.gov/api/Keyword/?billStatusId=70434
02:06:41 INFO pupa: save bill SCM1004 in 53rd-2nd-regular as bill_29dda04a-64a1-11e8-a364-027506b8472c.json
02:06:41 INFO scrapelib: GET - https://apps.azleg.gov/api/Bill/?billNumber=SCM1005&sessionId=119&legislativeBody=S
02:06:42 INFO scrapelib: GET - https://apps.azleg.gov/api/DocType/?billStatusId=70435
02:06:44 INFO scrapelib: GET - https://apps.azleg.gov/api/BillSponsor/?id=70435
02:06:44 INFO scrapelib: GET - https://apps.azleg.gov/api/Keyword/?billStatusId=70435
02:06:45 INFO pupa: save bill SCM1005 in 53rd-2nd-regular as bill_2c415124-64a1-11e8-a364-027506b8472c.json
02:06:45 INFO scrapelib: GET - https://apps.azleg.gov/api/Bill/?billNumber=SCM1006&sessionId=119&legislativeBody=S
02:06:46 INFO scrapelib: GET - https://apps.azleg.gov/api/DocType/?billStatusId=70522
02:06:48 INFO scrapelib: GET - https://apps.azleg.gov/api/BillSponsor/?id=70522
02:06:48 INFO scrapelib: GET - https://apps.azleg.gov/api/Keyword/?billStatusId=70522
02:06:49 INFO pupa: save bill SCM1006 in 53rd-2nd-regular as bill_2ea2d47e-64a1-11e8-a364-027506b8472c.json
02:06:49 INFO scrapelib: GET - https://apps.azleg.gov/api/Bill/?billNumber=SCM1007&sessionId=119&legislativeBody=S
02:06:51 INFO scrapelib: GET - https://apps.azleg.gov/api/DocType/?billStatusId=70613
02:06:52 INFO scrapelib: GET - https://apps.azleg.gov/api/BillSponsor/?id=70613
02:06:53 INFO scrapelib: GET - https://apps.azleg.gov/api/Keyword/?billStatusId=70613
02:06:53 INFO scrapelib: GET - https://apps.azleg.gov/api/BillStatusFloorAction
loaded Open States pupa settings...
az (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/az/bills.py", line 295, in scrape
    yield from self.scrape_bill(chamber, session, bill_id, session_id)
  File "/opt/openstates/openstates/openstates/az/bills.py", line 46, in scrape_bill
    yield from self.scrape_votes(bill, page)
  File "/opt/openstates/openstates/openstates/az/bills.py", line 227, in scrape_votes
    for action in actions:
TypeError: 'method' object is not iterable
```

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



Discussion:
I'm on this, have a fix in testing.

Resolving patch:
diff --git a/openstates/az/bills.py b/openstates/az/bills.py
--- a/openstates/az/bills.py
+++ b/openstates/az/bills.py
@@ -258,7 +258,7 @@ def scrape_votes(self, bill, page):
                         'N': 'no',
                     }.get(v['Vote'], 'other')
                     vote.vote(vote_type, v['Legislator']['FullName'])
-
+                vote.pupa_id = resp.url+str(action['ReferralNumber'])
                 yield vote
 
     def scrape(self, chamber=None, session=None):


Test patch: