Dy commited on
Commit
4b66db0
1 Parent(s): c39e39e

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -2
app.py CHANGED
@@ -54,8 +54,9 @@ def process_files(file, url):
54
  del word_list
55
 
56
  # Extract text from URL
57
-
58
- response = requests.get(url)
 
59
  soup = BeautifulSoup(response.text, 'html.parser')
60
  raw_text = soup.get_text()
61
  text_from_url = ' '.join(raw_text.split())
 
54
  del word_list
55
 
56
  # Extract text from URL
57
+
58
+ headers={"user-agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/92.0.4515.159 Safari/537.36"}
59
+ response = requests.get(url,headers=headers)
60
  soup = BeautifulSoup(response.text, 'html.parser')
61
  raw_text = soup.get_text()
62
  text_from_url = ' '.join(raw_text.split())