From 50c98142b86224c84dfc5587393b63921b48a0e5 Mon Sep 17 00:00:00 2001 From: ashleyzhang01 Date: Wed, 6 Mar 2024 02:15:34 -0500 Subject: [PATCH] headers --- backend/penndata/management/commands/get_rodin_events.py | 3 +-- backend/penndata/management/commands/get_venture_events.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/backend/penndata/management/commands/get_rodin_events.py b/backend/penndata/management/commands/get_rodin_events.py index 6daa3cbb..8998c635 100644 --- a/backend/penndata/management/commands/get_rodin_events.py +++ b/backend/penndata/management/commands/get_rodin_events.py @@ -11,8 +11,7 @@ RODIN_EVENTS_WEBSITE = "https://rodin.house.upenn.edu" HEADERS = { - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Apple" + - "WebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" + "User-Agent": "Mozilla/5.0 AppleWebKit/537.36 Chrome/91.0.4472.124 Safari/537.36" } diff --git a/backend/penndata/management/commands/get_venture_events.py b/backend/penndata/management/commands/get_venture_events.py index 95b9bb8c..a2a9ecbc 100644 --- a/backend/penndata/management/commands/get_venture_events.py +++ b/backend/penndata/management/commands/get_venture_events.py @@ -12,8 +12,7 @@ VENTURE_EVENTS_WEBSITE = "https://venturelab.upenn.edu/venture-lab-events" HEADERS = { - "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) Apple" + - "WebKit/537.36 (KHTML, like Gecko) Chrome/91.0.4472.124 Safari/537.36" + "User-Agent": "Mozilla/5.0 AppleWebKit/537.36 Chrome/91.0.4472.124 Safari/537.36" } @@ -26,7 +25,7 @@ def handle(self, *args, **kwargs): resp = requests.get(VENTURE_EVENTS_WEBSITE, headers=HEADERS) except ConnectionError: return None - + soup = BeautifulSoup(resp.text, "html.parser") event_containers = soup.find_all("div", class_="PromoSearchResultEvent")