Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -96,15 +96,17 @@ def get_pdf_text(pdf_docs):
|
|
96 |
return text
|
97 |
|
98 |
def get_url_text(url_link):
|
99 |
-
|
100 |
-
|
101 |
-
|
102 |
-
|
103 |
-
|
104 |
-
|
105 |
-
|
106 |
-
|
107 |
-
|
|
|
|
|
108 |
|
109 |
|
110 |
with st.sidebar:
|
|
|
96 |
return text
|
97 |
|
98 |
def get_url_text(url_link):
|
99 |
+
try:
|
100 |
+
loader = WebBaseLoader(url_link)
|
101 |
+
loader.requests_per_second = 1
|
102 |
+
docs = loader.aload()
|
103 |
+
extracted_text = ""
|
104 |
+
for page in docs:
|
105 |
+
extracted_text += page.page_content
|
106 |
+
return extracted_text
|
107 |
+
except Exception as e:
|
108 |
+
print(f"Error fetching or processing URL: {e}")
|
109 |
+
return ""
|
110 |
|
111 |
|
112 |
with st.sidebar:
|