Skip to content

Commit d5eb066

Browse files
Merge pull request #5700 from openstates/ga-bill-verison-urls-special
GA: fix bill version URLs for special session 2026
2 parents 5fa7cbf + 56b769e commit d5eb066

2 files changed

Lines changed: 19 additions & 6 deletions

File tree

scrapers/ga/bills.py

Lines changed: 15 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,14 @@
44

55
from openstates.scrape import Scraper, Bill, VoteEvent
66

7-
from .util import get_client, get_url, backoff, get_token, SESSION_SITE_IDS
7+
from .util import (
8+
get_client,
9+
get_url,
10+
backoff,
11+
get_token,
12+
SESSION_SITE_IDS,
13+
SPECIAL_SESSION_SITE_URL_PARTS,
14+
)
815

916
# Methods (7):
1017
# GetLegislationDetail(xs:int LegislationId, )
@@ -365,11 +372,13 @@ def scrape(self, session=None, chamber=None):
365372
url = (
366373
f"https://www.legis.ga.gov/api/legislation/document/{bill_bit}"
367374
)
368-
if session == "2023_ss":
369-
# gets url as 2023EX220573.pdf
370-
# so would be easier to put together using session & version id
371-
# to get https://www.legis.ga.gov/api/legislation/document/2023EX/220573
372-
url = f"https://www.legis.ga.gov/api/legislation/document/2023EX/{doc_id}"
375+
if session in ["2023_ss", "2026_ss"]:
376+
# Last couple special sessions the url provided in instrument["Versions"]["DocumentDescription"]
377+
# is wrong, so it'll look like http://www.legis.ga.gov/Legislation/2026EX/249298.pdf
378+
# but that URL does not resolve (gets 404 on GA page)
379+
# the web UI actually gets to you to a path that uses a varient session ID and the doc_id
380+
# like https://www.legis.ga.gov/api/legislation/document/2026EX/249298
381+
url = f"https://www.legis.ga.gov/api/legislation/document/{SPECIAL_SESSION_SITE_URL_PARTS[session]}/{doc_id}"
373382
link = bill.add_version_link(name, url, media_type="application/pdf")
374383
link["extras"] = {
375384
"_internal_document_id": doc_id,

scrapers/ga/util.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,10 @@ def _():
6767
"2011_ss": 22,
6868
"2011_12": 21,
6969
}
70+
SPECIAL_SESSION_SITE_URL_PARTS = {
71+
"2026_ss": "2026EX",
72+
"2023_ss": "2023EX",
73+
}
7074

7175

7276
def get_key(timestamp):

0 commit comments

Comments
 (0)