Repository: openstates/openstates-scrapers

Issue:
MD failing since at least 2018-03-10
MD has been failing since 2018-03-10

Based on automated runs it appears that MD has not run successfully in 2 days (2018-03-10).


```
  00:45:30 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1807&stab=01&pid=billpage&tab=subject3&ys=2018rs
00:45:31 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1807&stab=02&pid=billpage&tab=subject3&ys=2018rs
00:45:32 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1807&stab=03&pid=billpage&tab=subject3&ys=2018rs
00:45:33 INFO pupa: save bill HB1807 in 2018 as bill_cadf21e2-24f7-11e8-83cd-0a58a9feac2a.json
00:45:33 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1808&stab=01&pid=billpage&tab=subject3&ys=2018rs
00:45:34 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1808&stab=02&pid=billpage&tab=subject3&ys=2018rs
00:45:35 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1808&stab=03&pid=billpage&tab=subject3&ys=2018rs
00:45:37 INFO pupa: save bill HB1808 in 2018 as bill_cca9bc80-24f7-11e8-83cd-0a58a9feac2a.json
00:45:37 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1809&stab=01&pid=billpage&tab=subject3&ys=2018rs
00:45:37 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1809&stab=02&pid=billpage&tab=subject3&ys=2018rs
00:45:38 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1809&stab=03&pid=billpage&tab=subject3&ys=2018rs
00:45:39 INFO pupa: save bill HB1809 in 2018 as bill_ce74355e-24f7-11e8-83cd-0a58a9feac2a.json
00:45:39 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1810&stab=01&pid=billpage&tab=subject3&ys=2018rs
00:45:40 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1810&stab=02&pid=billpage&tab=subject3&ys=2018rs
00:45:41 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1810&stab=03&pid=billpage&tab=subject3&ys=2018rs
00:45:42 INFO pupa: save bill HB1810 in 2018 as bill_d03e16b6-24f7-11e8-83cd-0a58a9feac2a.json
00:45:42 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1811&stab=01&pid=billpage&tab=subject3&ys=2018rs
00:45:43 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1811&stab=02&pid=billpage&tab=subject3&ys=2018rs
00:45:44 INFO scrapelib: GET - http://mgaleg.maryland.gov/webmga/frmMain.aspx?id=HB1811&stab=03&pid=billpage&tab=subject3&ys=2018rs
00:45:45 INFO scrapelib: GET - http://mgaleg.maryland.gov/2018RS/votes/House/0224.pdf
00:45:46 ERROR pupa: Motion Extracted: Shall the Bill be Introduced?
loaded Open States pupa settings...
md (scrape, import)
  bills: {}
  committees: {}
  people: {}
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/md/bills.py", line 532, in scrape
    yield from self.scrape_chamber(chamber, session)
  File "/opt/openstates/openstates/openstates/md/bills.py", line 561, in scrape_chamber
    yield from self.scrape_bill(chamber, session, bill_id, url)
  File "/opt/openstates/openstates/openstates/md/bills.py", line 439, in scrape_bill
    yield from self.parse_bill_votes_new(doc, bill)
  File "/opt/openstates/openstates/openstates/md/bills.py", line 180, in parse_bill_votes_new
    vote = self.parse_vote_pdf(href, bill)
  File "/opt/openstates/openstates/openstates/md/bills.py", line 227, in parse_vote_pdf
    raise ValueError("No Motion or faulty Motion scraped.")
ValueError: No Motion or faulty Motion scraped.
```

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



Discussion:
Checked it, there seems to be one new vote(calender date: 6th march) where motion is not given. Will put up a PR, to let the scraper continue, in case of NO motion, I think a pupa warning or error, should do here "Blank motion for this bill" or something like this
@In-vincible, it seems like the motion _is_ actually `Shall the Bill be Introduced?`. That is, it's a vote on whether to introduce the bill at all. So, it's not a blank motion, but rather something that should be added to `motion_keywords`, right?
Yes, I am going to do make changes to the list for this one.

Resolving patch:
diff --git a/openstates/md/bills.py b/openstates/md/bills.py
--- a/openstates/md/bills.py
+++ b/openstates/md/bills.py
@@ -218,7 +218,8 @@ def parse_vote_pdf(self, vote_url, bill):
 
         passed = vote_counts[0] > vote_counts[1]
         motion = re.split(r'\s{2,}', lines[page_index-3].strip())[0]
-        motion_keywords = ['favorable', 'reading', 'amendment', 'motion']
+        motion_keywords = ['favorable', 'reading', 'amendment', 'motion',
+                           'bill be introduced']
 
         if not any(motion_keyword in motion.lower() for motion_keyword in motion_keywords):
             motion = re.split(r'\s{2,}', lines[page_index-2].strip())[0]


Test patch: