sintamar commited on
Commit
31bbe73
·
verified ·
1 Parent(s): b074e5f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -3
app.py CHANGED
@@ -26,9 +26,13 @@ def visualize(url):
26
  # innerHTML = get_innerHTML(url)
27
  html_content, xdataframe, baris = take_webdata(url)
28
  #st.subheader("Website title:")
 
 
 
 
29
  if xdataframe:
30
  #st.info(html_content)
31
- st.code(baris, language='html')
32
  # Konversi tabel HTML ke DataFrame Pandas
33
  #df = pd.read_html(str(parse_element))[0]
34
  #st.dataframe(df) # tampilkan tabel dengan format rapi Streamlit
@@ -58,8 +62,8 @@ def take_webdata(url):
58
  html = wd.execute_script("return document.documentElement.outerHTML;")
59
  soup = BeautifulSoup(html, "html.parser")
60
  div_find = soup.find("div", id="tournament-table", class_="tournament-table-standings")
61
- #table_find = div_find.find("table") if div_find else None
62
- rows = soup.find("div", class_="ui-table__row ")
63
  data = []
64
  #for row in rows:
65
  #rank = row.select_one(".tableCellRank")
 
26
  # innerHTML = get_innerHTML(url)
27
  html_content, xdataframe, baris = take_webdata(url)
28
  #st.subheader("Website title:")
29
+ if baris:
30
+ st.code(baris, language='html')
31
+ else:
32
+ st.warning("Rows tidak ditemukan.")
33
  if xdataframe:
34
  #st.info(html_content)
35
+
36
  # Konversi tabel HTML ke DataFrame Pandas
37
  #df = pd.read_html(str(parse_element))[0]
38
  #st.dataframe(df) # tampilkan tabel dengan format rapi Streamlit
 
62
  html = wd.execute_script("return document.documentElement.outerHTML;")
63
  soup = BeautifulSoup(html, "html.parser")
64
  div_find = soup.find("div", id="tournament-table", class_="tournament-table-standings")
65
+ rows = div_find.find("ui-table__row ") if div_find else None
66
+ #rows = soup.find("div", class_="ui-table__row ")
67
  data = []
68
  #for row in rows:
69
  #rank = row.select_one(".tableCellRank")