From 526ad20303ce3104fe4928adf02e318765353c25 Mon Sep 17 00:00:00 2001 From: Eric Wang Date: Sun, 19 May 2019 09:02:24 -0400 Subject: [PATCH] add user agent for fitness endpoint --- penn/fitness.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/penn/fitness.py b/penn/fitness.py index 3fc1154..b4106b3 100644 --- a/penn/fitness.py +++ b/penn/fitness.py @@ -49,7 +49,9 @@ def get_schedule(self): def get_usage(self): """Get fitness locations and their current usage.""" - resp = requests.get(FITNESS_URL, timeout=30) + resp = requests.get(FITNESS_URL, headers={ + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/73.0.3683.103 Safari/537.36" + }, timeout=30) resp.raise_for_status() soup = BeautifulSoup(resp.text, "html5lib")