Update app.py
Browse files
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.
|
| 116 |
soup = BeautifulSoup(src, 'html.parser')
|
|
|
|
| 117 |
text_data = ''
|
| 118 |
-
|
| 119 |
-
|
|
|
|
|
|
|
| 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://
|
| 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])
|