sintamar commited on
Commit
adb14de
·
verified ·
1 Parent(s): 9f0f1a8

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +12 -11
app.py CHANGED
@@ -56,17 +56,17 @@ def visualize(url):
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,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")