diff --git a/scrapers/ar/bills.py b/scrapers/ar/bills.py index bc5161393b..6bcb262981 100644 --- a/scrapers/ar/bills.py +++ b/scrapers/ar/bills.py @@ -2,8 +2,8 @@ import csv import urllib import datetime -import os import pytz +import os from openstates.scrape import Scraper, Bill, VoteEvent from openstates.exceptions import EmptyScrape @@ -192,7 +192,7 @@ def scrape_bill_page(self, bill): odd_year = session_year if session_year % 2 else session_year - 1 measureno = bill.identifier.replace(" ", "") url = ( - "http://www.arkleg.state.ar.us/assembly/%s/%s/" + "https://www.arkleg.state.ar.us/assembly/%s/%s/" "Pages/BillInformation.aspx?measureno=%s" % (odd_year, self.slug, measureno) ) page = self.get(url).text @@ -329,18 +329,16 @@ def scrape_bill_page(self, bill): media_type="application/pdf", ) - # TODO: reincorporate below code block for vote processing - # (commented out due to scraper having vote event processing issue) - # for link in page.xpath( - # "//div[@role=\"grid\"]/../..//a[contains(@href, '/Bills/Votes?id=')]" - # ): - # date = link.xpath("normalize-space(string(../../div[2]))") - # date = TIMEZONE.localize( - # datetime.datetime.strptime(date, "%m/%d/%Y %I:%M:%S %p") - # ) - # - # motion = link.xpath("string(../../div[3])") - # yield from self.scrape_vote(bill, date, motion, link.attrib["href"]) + for link in page.xpath( + "//*[@id='tableDataWrapper']/div/div[4]/a[contains(@href, '/Bills/Votes?id=')]" + ): + date = link.xpath("normalize-space(string(../../div[2]))") + date = TIMEZONE.localize( + datetime.datetime.strptime(date, "%m/%d/%Y %I:%M:%S %p") + ) + + motion = link.xpath("string(../../div[3])") + yield from self.scrape_vote(bill, date, motion, link.attrib["href"]) def scrape_vote(self, bill, date, motion, url): page = self.get(url).text