Skip to content

Commit

Permalink
WV: fix for new website url
Browse files Browse the repository at this point in the history
  • Loading branch information
showerst committed Nov 17, 2023
1 parent 839aeb1 commit 2e3a501
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion scrapers/wv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,6 @@ def get_session_list(self):
from utils import url_xpath

return url_xpath(
"http://www.legis.state.wv.us/Bill_Status/Bill_Status.cfm",
"https://www.wvlegislature.gov/Bill_Status/Bill_Status.cfm",
'//select[@name="year"]/option/text()',
)
12 changes: 6 additions & 6 deletions scrapers/wv/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def scrape_chamber(self, chamber, session):
# scrape bills
if "special" in self.jurisdiction.legislative_sessions[-1]["name"].lower():
url = (
"http://www.legis.state.wv.us/Bill_Status/Bills_all_bills.cfm?"
"https://www.wvlegislature.gov/Bill_Status/Bills_all_bills.cfm?"
"year=%s&sessiontype=%s&btype=bill&orig=%s"
% (
self.jurisdiction.legislative_sessions[-1]["_scraped_name"],
Expand All @@ -85,7 +85,7 @@ def scrape_chamber(self, chamber, session):
)
else:
url = (
"http://www.legis.state.wv.us/Bill_Status/Bills_all_bills.cfm?"
"https://www.wvlegislature.gov/Bill_Status/Bills_all_bills.cfm?"
"year=%s&sessiontype=RS&btype=bill&orig=%s" % (session, orig)
)

Expand All @@ -98,7 +98,7 @@ def scrape_chamber(self, chamber, session):
# "upper",
# "SB 500",
# "test",
# "http://www.legis.state.wv.us/Bill_Status/Bills_history.cfm?input=500&year=2020&sessiontype=RS&btype=bill",
# "https://www.wvlegislature.gov/Bill_Status/Bills_history.cfm?input=500&year=2020&sessiontype=RS&btype=bill",
# )

for link in page.xpath("//a[contains(@href, 'Bills_history')]"):
Expand All @@ -114,7 +114,7 @@ def scrape_chamber(self, chamber, session):
# scrape resolutions
if "special" in self.jurisdiction.legislative_sessions[-1]["name"].lower():
res_url = (
"http://www.legis.state.wv.us/Bill_Status/res_list.cfm?year=%s"
"https://www.wvlegislature.gov/Bill_Status/res_list.cfm?year=%s"
"&sessiontype=%s&btype=res"
% (
self.jurisdiction.legislative_sessions[-1]["_scraped_name"],
Expand All @@ -123,7 +123,7 @@ def scrape_chamber(self, chamber, session):
)
else:
res_url = (
"http://www.legis.state.wv.us/Bill_Status/res_list.cfm?year=%s"
"https://www.wvlegislature.gov/Bill_Status/res_list.cfm?year=%s"
"&sessiontype=rs&btype=res"
% (self.jurisdiction.legislative_sessions[-1]["_scraped_name"])
)
Expand Down Expand Up @@ -426,7 +426,7 @@ def scrape_senate_vote(self, bill, url, date):

def scrape_senate_vote_3col(self, bill, vote, text, url, date):
"""Scrape senate votes like this one:
http://www.legis.state.wv.us/legisdocs/2013/RS/votes/senate/02-26-0001.pdf
https://www.wvlegislature.gov/legisdocs/2013/RS/votes/senate/02-26-0001.pdf
"""
counts = dict(re.findall(r"(Yea|Nay|Absent): (\d+)", text))
lines = filter(None, text.splitlines())
Expand Down

0 comments on commit 2e3a501

Please sign in to comment.