Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -71,7 +71,7 @@ def get_links(url):
|
|
71 |
result = response.choices[0].message.content
|
72 |
return json.loads(result)
|
73 |
|
74 |
-
|
75 |
def get_all_details(url):
|
76 |
result = "Home page:\n"
|
77 |
result += Website(url).get_contents()
|
@@ -101,14 +101,12 @@ if user_query:
|
|
101 |
|
102 |
# Scrape website content
|
103 |
with st.spinner("Scraping website..."):
|
104 |
-
website = get_all_details(url)
|
105 |
-
|
106 |
-
|
107 |
-
st.success("Website loaded successfully!")
|
108 |
-
# st.write(f"**Website Title:** {website.title}")
|
109 |
|
110 |
-
|
111 |
-
|
|
|
|
|
|
|
112 |
|
113 |
|
114 |
# Call Groq API for processing
|
|
|
71 |
result = response.choices[0].message.content
|
72 |
return json.loads(result)
|
73 |
|
74 |
+
@st.cache_data
|
75 |
def get_all_details(url):
|
76 |
result = "Home page:\n"
|
77 |
result += Website(url).get_contents()
|
|
|
101 |
|
102 |
# Scrape website content
|
103 |
with st.spinner("Scraping website..."):
|
|
|
|
|
|
|
|
|
|
|
104 |
|
105 |
+
try:
|
106 |
+
website = get_all_details(url)
|
107 |
+
st.success("Website loaded successfully!")
|
108 |
+
except Exception as e:
|
109 |
+
st.error(f"Failed to load website: {e}")
|
110 |
|
111 |
|
112 |
# Call Groq API for processing
|