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

Fixing GA Events Scraper #5058

Merged
merged 2 commits into from
Oct 21, 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
12 changes: 9 additions & 3 deletions scrapers/ga/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ def scrape(self, start=None):
if "joint" not in title.lower():
if row["chamber"] == 2:
title = f"Senate {title}"
elif row["chamber"] == 1:
elif row["chamber"] == 1 and not title.startswith("House"):
title = f"House {title}"

start = dateutil.parser.parse(row["start"])
Expand All @@ -54,7 +54,13 @@ def scrape(self, start=None):
title = re.sub(r"-?\s*cancell?ed\s*-?\s*", " ", title, flags=re.I)

where = row["location"]
where = f"206 Washington St SW, Atlanta, Georgia, {where}"
# Check if location already has the state abbr + ZIP code, this indicates that
# the location is not at the state capitol
if not re.search("GA [0-9]{5}", where):
# Otherwise, the location is the room/place within the capitol where the event will take place
where = (
f"State Capitol, {where}, 206 Washington St SW, Atlanta, GA 30334"
)

event = Event(
name=title,
Expand All @@ -81,7 +87,7 @@ def scrape(self, start=None):

if row["livestreamUrl"]:
event.add_media_link(
"Video", row["livestreamUrl"], media_type="text/html"
"Livestream", row["livestreamUrl"], media_type="text/html"
)

if "committee" in title.lower():
Expand Down
Loading