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

Fix ssl.CertificateError: hostname 'www.memberguide.gpo.gov' doesn't match 'memberguide.gpo.gov' #151

Merged
merged 1 commit into from
Nov 23, 2017
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ If you want to quickly grab all images of a particular size without cloning the
[![Build Status](https://travis-ci.org/unitedstates/images.svg?branch=gh-pages)](https://travis-ci.org/unitedstates/images)
[![Coverage Status](https://coveralls.io/repos/unitedstates/images/badge.svg?branch=gh-pages&service=github)](https://coveralls.io/github/unitedstates/images?branch=gh-pages)

This project uses a Python script that scrapes the [Government Printing Office's Member Guide](http://memberguide.gpo.gov/) for official photos of Members of Congress. You can run the script to find and fetch new photos.
This project uses a Python script that scrapes the [Government Printing Office's Member Guide](https://memberguide.gpo.gov/) for official photos of Members of Congress. You can run the script to find and fetch new photos.

Install dependencies with:

Expand Down
8 changes: 4 additions & 4 deletions scripts/gpo_member_photos.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Scrape http://memberguide.gpo.gov and
Scrape https://memberguide.gpo.gov and
save members' photos named after their Bioguide IDs.
"""
from __future__ import print_function, unicode_literals
Expand Down Expand Up @@ -101,7 +101,7 @@ def save_metadata(bioguide_id):
outfile = os.path.join(outdir, bioguide_id + ".yaml")
with open(outfile, "w") as f:
f.write("name: GPO Member Guide\n")
f.write("link: http://memberguide.gpo.gov\n")
f.write("link: https://memberguide.gpo.gov\n")


def download_file(url, outfile):
Expand All @@ -125,7 +125,7 @@ def download_photos(br, photo_list, outdir, delay):
ok = 0

for bioguide_id, photo_filename in photo_list:
photo_url = ("http://www.memberguide.gpo.gov/PictorialImages/" +
photo_url = ("https://memberguide.gpo.gov/PictorialImages/" +
photo_filename)
print(bioguide_id, photo_url)

Expand Down Expand Up @@ -153,7 +153,7 @@ def resize_photos():

if __name__ == "__main__":
parser = argparse.ArgumentParser(
description="Scrape http://memberguide.gpo.gov and save "
description="Scrape https://memberguide.gpo.gov and save "
"members' photos named after their Bioguide IDs",
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
parser.add_argument(
Expand Down