From dc55f507d4224c1bf62522b95dcaf12900a6461e Mon Sep 17 00:00:00 2001 From: Michael Hucka Date: Thu, 28 Jun 2018 17:10:20 -0700 Subject: [PATCH] Add more detail to user-agent string I had one host refuse to respond, and when I added a longer user-agent string, it worked. --- turf/turf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/turf/turf.py b/turf/turf.py index 27e6a0d..a91f0d5 100755 --- a/turf/turf.py +++ b/turf/turf.py @@ -185,7 +185,7 @@ def _extracted_data(marcxml, proxyinfo): # Setting the user agent is because Proquest.com returns a 403 # otherwise, possibly as an attempt to block automated scraping. # Changing the user agent to a browser name seems to solve it. - headers = {'User-Agent': 'Mozilla/5.0'} + headers = {'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X x.y; rv:42.0)'} # This next thing is a hack that makes ebscohost think we're logged in. # It's the only way I found so far to avoid the occasional "upcoming # maintenance" announcement click-through pages.