mou3az commited on
Commit
5a2b8e5
1 Parent(s): 6bf79b7

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -4
app.py CHANGED
@@ -112,11 +112,14 @@ def process_youtube_video(url, languages=['en', 'ar']):
112
  def read_web_page(url):
113
  result = requests.get(url)
114
  if result.status_code == 200:
115
- src = result.content
116
  soup = BeautifulSoup(src, 'html.parser')
 
117
  text_data = ''
118
- for p in soup.find_all('p'):
119
- text_data += p.get_text() + '\n'
 
 
120
  return text_data
121
  else:
122
  return "Please provide a valid webpage link"
@@ -415,7 +418,7 @@ def Explore_WebSite(history):
415
  message=history[-1][0]
416
 
417
  links = [
418
- 'https://github.com/1Mou3az/ChatBot/blob/main/Chat_Bot.ipynb'
419
  ]
420
 
421
  result = "\n".join([read_data(link) for link in links])
 
112
  def read_web_page(url):
113
  result = requests.get(url)
114
  if result.status_code == 200:
115
+ src = result.text
116
  soup = BeautifulSoup(src, 'html.parser')
117
+
118
  text_data = ''
119
+ div_elements = soup.find_all('div')
120
+ for div in div_elements:
121
+ text_data += div.get_text() + '\n'
122
+
123
  return text_data
124
  else:
125
  return "Please provide a valid webpage link"
 
418
  message=history[-1][0]
419
 
420
  links = [
421
+ 'https://huggingface.co/mou3az'
422
  ]
423
 
424
  result = "\n".join([read_data(link) for link in links])