Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IL: add votes back #4914

Merged
merged 2 commits into from
Apr 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions scrapers/il/bills.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
# -*- coding: utf-8 -*-
from ._utils import canonicalize_url
import re
import os
import datetime
Expand All @@ -10,8 +11,6 @@

central = pytz.timezone("US/Central")

# from ._utils import canonicalize_url


session_details = {
"103rd": {
Expand Down Expand Up @@ -504,7 +503,7 @@ def scrape_bill(self, chamber, session, doc_type, url, bill_type=None):
sponsor_list = build_sponsor_list(doc.xpath('//a[contains(@class, "content")]'))
# don't add just yet; we can make them better using action data

# committee_actors = {}
committee_actors = {}

# actions
action_tds = doc.xpath('//a[@name="actions"]/following-sibling::table[1]/td')
Expand All @@ -520,15 +519,15 @@ def scrape_bill(self, chamber, session, doc_type, url, bill_type=None):
action = action_elem.text_content()
classification, related_orgs = _categorize_action(action)

# if related_orgs and any(c.startswith("committee") for c in classification):
# ((name, source),) = [
# (a.text, a.get("href"))
# for a in action_elem.xpath("a")
# if "committee" in a.get("href")
# ]
# source = canonicalize_url(source)
# actor_id = {"sources__url": source, "classification": "committee"}
# committee_actors[source] = name
if related_orgs and any(c.startswith("committee") for c in classification):
((name, source),) = [
(a.text, a.get("href"))
for a in action_elem.xpath("a")
if "committee" in a.get("href")
]
source = canonicalize_url(source)
actor_id = {"sources__url": source, "classification": "committee"}
committee_actors[source] = name

bill.add_action(
action,
Expand Down Expand Up @@ -560,8 +559,8 @@ def scrape_bill(self, chamber, session, doc_type, url, bill_type=None):
yield bill

# temporarily remove vote processing due to pdf issues
# votes_url = doc.xpath('//a[text()="Votes"]/@href')[0]
# yield from self.scrape_votes(session, bill, votes_url, committee_actors)
votes_url = doc.xpath('//a[text()="Votes"]/@href')[0]
yield from self.scrape_votes(session, bill, votes_url, committee_actors)

def scrape_documents(self, bill, version_url):
html = self.get(version_url).text
Expand Down
Loading