Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,12 +1,21 @@
|
|
| 1 |
# === Home.py (Main file) ===
|
| 2 |
|
|
|
|
| 3 |
import subprocess
|
| 4 |
|
| 5 |
-
# Install Playwright browsers
|
| 6 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
-
import streamlit as st
|
| 9 |
|
|
|
|
| 10 |
st.set_page_config(
|
| 11 |
page_title="Home",
|
| 12 |
page_icon="🏠"
|
|
|
|
| 1 |
# === Home.py (Main file) ===
|
| 2 |
|
| 3 |
+
import streamlit as st
|
| 4 |
import subprocess
|
| 5 |
|
| 6 |
+
# Install all Playwright browsers with system dependencies
|
| 7 |
+
try:
|
| 8 |
+
subprocess.run(
|
| 9 |
+
["playwright", "install", "--with-deps", "chromium", "firefox", "webkit"],
|
| 10 |
+
check=True
|
| 11 |
+
)
|
| 12 |
+
print("Successfully installed all browsers for Crawl4AI.")
|
| 13 |
+
except subprocess.CalledProcessError as e:
|
| 14 |
+
print(f"Browser installation failed: {e}")
|
| 15 |
+
|
| 16 |
|
|
|
|
| 17 |
|
| 18 |
+
# APP code
|
| 19 |
st.set_page_config(
|
| 20 |
page_title="Home",
|
| 21 |
page_icon="🏠"
|