Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -56,17 +56,17 @@ def visualize(url):
|
|
| 56 |
st.dataframe(df)
|
| 57 |
else:
|
| 58 |
st.warning("Rows tidak ditemukan.")
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
|
| 71 |
except Exception as e:
|
| 72 |
st.error(f"Error: {e}")
|
|
@@ -85,6 +85,7 @@ def take_webdata(url):
|
|
| 85 |
# Get the page title
|
| 86 |
page_title = wd.title
|
| 87 |
#screenshot = wd.get_screenshot_as_png()
|
|
|
|
| 88 |
html = wd.execute_script("return document.documentElement.outerHTML;")
|
| 89 |
soup = BeautifulSoup(html, "html.parser")
|
| 90 |
div_find = soup.find("div", id="tournament-table", class_="tournament-table-standings")
|
|
|
|
| 56 |
st.dataframe(df)
|
| 57 |
else:
|
| 58 |
st.warning("Rows tidak ditemukan.")
|
| 59 |
+
if xdataframe:
|
| 60 |
+
#st.info(html_content)
|
| 61 |
+
|
| 62 |
+
# Konversi tabel HTML ke DataFrame Pandas
|
| 63 |
+
#df = pd.read_html(str(parse_element))[0]
|
| 64 |
+
#st.dataframe(df) # tampilkan tabel dengan format rapi Streamlit
|
| 65 |
+
st.components.v1.html(str(xdataframe), height=600, scrolling=True)
|
| 66 |
+
# === 6. Tampilkan di Streamlit ===
|
| 67 |
+
#st.dataframe(xdataframe)
|
| 68 |
+
else:
|
| 69 |
+
st.warning("Tabel tidak ditemukan.")
|
| 70 |
|
| 71 |
except Exception as e:
|
| 72 |
st.error(f"Error: {e}")
|
|
|
|
| 85 |
# Get the page title
|
| 86 |
page_title = wd.title
|
| 87 |
#screenshot = wd.get_screenshot_as_png()
|
| 88 |
+
WebDriverWait(wd, 20).until(EC.presence_of_element_located((By.ID, "tournament-table")))
|
| 89 |
html = wd.execute_script("return document.documentElement.outerHTML;")
|
| 90 |
soup = BeautifulSoup(html, "html.parser")
|
| 91 |
div_find = soup.find("div", id="tournament-table", class_="tournament-table-standings")
|