Skip to content

Handle 503 http errors when scraping event web details #127

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

Merged
merged 1 commit into from
Apr 15, 2025
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
7 changes: 7 additions & 0 deletions legistar/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,6 +386,13 @@ def web_detail(self, event):
except scrapelib.HTTPError as e:
if e.response.status_code == 410:
return None
elif e.response.status_code == 503:
# Events with draft agendas sometimes have an EventInSiteURL
# that resolves to a 503 status code
self.logger.error(
f"Error while fetching event detail at {insite_url}: {e}"
)
return None
else:
raise

Expand Down