Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -38,12 +38,12 @@ if process_url_clicked:
|
|
38 |
#main_placeholder.text("Data Loading...Started...β
β
β
")
|
39 |
#data = loader.load()
|
40 |
def fetch_web_content(url):
|
41 |
-
|
42 |
response = requests.get(url, timeout=10)
|
43 |
response.raise_for_status()
|
44 |
soup = BeautifulSoup(response.text, "html.parser")
|
45 |
return soup.get_text()
|
46 |
-
|
47 |
return f"Error fetching {url}: {str(e)}"
|
48 |
|
49 |
# Your list of URLs
|
|
|
38 |
#main_placeholder.text("Data Loading...Started...β
β
β
")
|
39 |
#data = loader.load()
|
40 |
def fetch_web_content(url):
|
41 |
+
try:
|
42 |
response = requests.get(url, timeout=10)
|
43 |
response.raise_for_status()
|
44 |
soup = BeautifulSoup(response.text, "html.parser")
|
45 |
return soup.get_text()
|
46 |
+
except Exception as e:
|
47 |
return f"Error fetching {url}: {str(e)}"
|
48 |
|
49 |
# Your list of URLs
|