|
4 | 4 |
|
5 | 5 | from openstates.scrape import Scraper, Bill, VoteEvent |
6 | 6 |
|
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 | +) |
8 | 15 |
|
9 | 16 | # Methods (7): |
10 | 17 | # GetLegislationDetail(xs:int LegislationId, ) |
@@ -365,11 +372,13 @@ def scrape(self, session=None, chamber=None): |
365 | 372 | url = ( |
366 | 373 | f"https://www.legis.ga.gov/api/legislation/document/{bill_bit}" |
367 | 374 | ) |
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}" |
373 | 382 | link = bill.add_version_link(name, url, media_type="application/pdf") |
374 | 383 | link["extras"] = { |
375 | 384 | "_internal_document_id": doc_id, |
|
0 commit comments