Add1E commited on
Commit
a3e4e5e
·
verified ·
1 Parent(s): cf0cf24

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -272,8 +272,11 @@ def get_article_summary(article: str) -> str:
272
 
273
  def extract_article(url):
274
  # Webseite herunterladen
275
- response = requests.get(url)
276
-
 
 
 
277
  # Überprüfen, ob die Anfrage erfolgreich war (Status-Code 200)
278
  if response.status_code == 200:
279
  # HTML-Inhalt parsen
 
272
 
273
  def extract_article(url):
274
  # Webseite herunterladen
275
+ headers = {
276
+ 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3'
277
+ }
278
+ response = requests.get(url, headers=headers)
279
+
280
  # Überprüfen, ob die Anfrage erfolgreich war (Status-Code 200)
281
  if response.status_code == 200:
282
  # HTML-Inhalt parsen