Update app.py
Browse files
app.py
CHANGED
|
@@ -1,32 +1,11 @@
|
|
| 1 |
-
import
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
header = next(reader)
|
| 13 |
-
data = list(reader)
|
| 14 |
-
df = pd.DataFrame(data, columns=header)
|
| 15 |
-
|
| 16 |
-
# ... (остальной код для расчета корреляций - без изменений)
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
except Exception as e:
|
| 20 |
-
return {"error": f"Неизвестная ошибка: {e}"}
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
iface = gr.Interface(
|
| 25 |
-
fn=calculate_correlations,
|
| 26 |
-
inputs=gr.File(type="filepath", label="CSV файл с отзывами"),
|
| 27 |
-
outputs=gr.JSON(),
|
| 28 |
-
title="Корреляционный анализ отзывов",
|
| 29 |
-
description="Загрузите CSV файл с отзывами."
|
| 30 |
-
)
|
| 31 |
-
|
| 32 |
-
iface.launch()
|
|
|
|
| 1 |
+
import requests
|
| 2 |
+
from bs4 import BeautifulSoup
|
| 3 |
+
# Fetch a web page
|
| 4 |
+
page = requests.get("http://www.example.com")
|
| 5 |
+
# Parse the HTML content
|
| 6 |
+
soup = BeautifulSoup(page.content, "html.parser")
|
| 7 |
+
# Find all the links on the page
|
| 8 |
+
links = soup.find_all("a")
|
| 9 |
+
# Print the links
|
| 10 |
+
for link in links:
|
| 11 |
+
print(link.get("href"))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|