seawolf2357 commited on
Commit
9f47898
ยท
verified ยท
1 Parent(s): 38b8df6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -4
app.py CHANGED
@@ -23,17 +23,18 @@ def gradio_fetch_and_parse(url):
23
 
24
  def get_main_content(html_content):
25
  soup = BeautifulSoup(html_content, 'html.parser')
26
- # ์ˆ˜์ •๋œ ์„ ํƒ์ž ์˜ˆ์‹œ
27
- main_content = soup.find('div', class_='content')
28
  if main_content:
29
  text = main_content.get_text(strip=True)
30
- print("์ถ”์ถœ๋œ ํ…์ŠคํŠธ:", text) # ๋””๋ฒ„๊น…์„ ์œ„ํ•œ ๋กœ๊ทธ
31
  return text
32
  else:
33
  print("๋ณธ๋ฌธ ์ฝ˜ํ…์ธ ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.")
34
  return ''
35
 
36
 
 
37
  def format_script(text):
38
  sentences = text.split('.')
39
  script = ""
@@ -74,4 +75,4 @@ iface_script = gr.Interface(
74
  # ๋‘ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํƒญ์œผ๋กœ ๊ตฌ์„ฑํ•˜์—ฌ ์‹คํ–‰
75
  iface_combined = gr.TabbedInterface([iface_html, iface_script],
76
  ["HTML ๋ณด๊ธฐ", "์Šคํฌ๋ฆฝํŠธ ์ƒ์„ฑ"])
77
- iface_combined.launch()
 
23
 
24
  def get_main_content(html_content):
25
  soup = BeautifulSoup(html_content, 'html.parser')
26
+ # <section> ํƒœ๊ทธ๋ฅผ ์ฐพ์•„ ๋ณธ๋ฌธ ์ฝ˜ํ…์ธ  ์ถ”์ถœ
27
+ main_content = soup.find('section')
28
  if main_content:
29
  text = main_content.get_text(strip=True)
30
+ print("์ถ”์ถœ๋œ ํ…์ŠคํŠธ:", text)
31
  return text
32
  else:
33
  print("๋ณธ๋ฌธ ์ฝ˜ํ…์ธ ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์Šต๋‹ˆ๋‹ค.")
34
  return ''
35
 
36
 
37
+
38
  def format_script(text):
39
  sentences = text.split('.')
40
  script = ""
 
75
  # ๋‘ ์ธํ„ฐํŽ˜์ด์Šค๋ฅผ ํƒญ์œผ๋กœ ๊ตฌ์„ฑํ•˜์—ฌ ์‹คํ–‰
76
  iface_combined = gr.TabbedInterface([iface_html, iface_script],
77
  ["HTML ๋ณด๊ธฐ", "์Šคํฌ๋ฆฝํŠธ ์ƒ์„ฑ"])
78
+ iface_combined.launch()