Skip to content

Commit

Permalink
Merge branch 'master' of github.com:sunlightlabs/openstates into turk…
Browse files Browse the repository at this point in the history
…eyvulture
  • Loading branch information
twneale committed Sep 21, 2012
2 parents 984ff3c + fcd5ab5 commit c2aad50
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion openstates/in/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,16 @@ def scrape_bill(self, session, chamber, bill_id, short_title, url):
path = version_path % version_type
links = page.xpath(path)
if links:
bill.add_version(version_type, links[0].attrib['href'])

_url = links[0].attrib['href']

# Set the mimetype.
if 'pdf' in _url:
mimetype = 'application/pdf'
else:
mimetype = 'text/html'

bill.add_version(version_type, _url, mimetype=mimetype)

for vote_link in page.xpath("//a[contains(@href, 'Srollcal')]"):
self.scrape_senate_vote(bill, vote_link.attrib['href'])
Expand Down

0 comments on commit c2aad50

Please sign in to comment.