Skip to content

Commit

Permalink
add user agent for fitness endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
ezwang committed May 19, 2019
1 parent 31ff12c commit 526ad20
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion penn/fitness.py
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit 526ad20

Please sign in to comment.