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

Empty list when running gpo_member_photos.py script #221

Open
mdrayer opened this issue Jul 18, 2024 · 3 comments
Open

Empty list when running gpo_member_photos.py script #221

mdrayer opened this issue Jul 18, 2024 · 3 comments

Comments

@mdrayer
Copy link
Contributor

mdrayer commented Jul 18, 2024

It seems that the scraper is no longer working. I get a "Just a moment..." HTML page for the response (https://github.com/unitedstates/images/blob/gh-pages/scripts/gpo_member_photos.py#L54). This can be replicated by doing a curl on the URL the scraper is trying to hit: https://www.congress.gov/search?q=%7B%22source%22%3A+%22members%22%2C+%22congress%22%3A+%22118%22%7D&pageSize=250&page=1.

Are there any troubleshooting techniques here to make the scraper wait a bit for the HTML to load + form?

@hugovk
Copy link
Member

hugovk commented Jul 19, 2024

Yeah, I think it's been a few years since the scraper script has been run to fetch images, so it's unsurprising it's not working properly. Scrapers needs quite a bit of upkeep!

Unfortunately I don't really have time to maintain this repo any more, so we should find some new maintainers willing to volunteer.

@mdrayer
Copy link
Contributor Author

mdrayer commented Jul 19, 2024

GPO.gov does have an API that includes these images we are attempting to scrape: https://pictorialapi.gpo.gov/. There's an endpoint to get all members of a particular session, e.g. 118th Congress: https://pictorialapi.gpo.gov/api/GuideMember/GetMembers/118 which yields images like https://memberguide.gpo.gov/pictorialimages/118_SR_NJ_Booker_Cory.jpg. However, it does not include the member's bioguide ID in the data, so we'd need to do some mapping with another dataset to get the bioguide ID.

kevinschaul added a commit to kevinschaul/us-images that referenced this issue Aug 30, 2024
Still need to fix some missing bioguide ids for 36 legislators, but it's
a start.

See unitedstates#221
@kevinschaul
Copy link

FYI I'm working to get pictorial ids into the legislators project: unitedstates/congress-legislators#943

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants