Spaces:
Sleeping
Sleeping
Update app.py
Browse files
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('
|
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()
|