Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,24 +23,22 @@ def gradio_fetch_and_parse(url):
|
|
23 |
|
24 |
def get_main_content(html_content):
|
25 |
soup = BeautifulSoup(html_content, 'html.parser')
|
26 |
-
#
|
27 |
-
|
28 |
-
|
29 |
-
|
30 |
-
|
31 |
-
meta_content.append(content.strip())
|
32 |
|
33 |
-
|
34 |
-
|
35 |
-
|
36 |
-
print("์ถ์ถ๋ ๋ฉํ ์ฝํ
์ธ :", extracted_content)
|
37 |
-
return extracted_content
|
38 |
else:
|
39 |
-
print("
|
40 |
return ''
|
41 |
|
42 |
|
43 |
|
|
|
44 |
def format_script(text):
|
45 |
sentences = text.split('.')
|
46 |
script = ""
|
|
|
23 |
|
24 |
def get_main_content(html_content):
|
25 |
soup = BeautifulSoup(html_content, 'html.parser')
|
26 |
+
# ํด๋์ค๋ช
์ด "a-list-item"์ธ ๋ชจ๋ <span> ํ๊ทธ๋ฅผ ์ฐพ์
|
27 |
+
list_items = soup.find_all('span', class_='a-list-item')
|
28 |
+
text = ''
|
29 |
+
for item in list_items:
|
30 |
+
text += item.get_text(strip=True) + '\n'
|
|
|
31 |
|
32 |
+
if text:
|
33 |
+
print("์ถ์ถ๋ ํ
์คํธ:", text)
|
34 |
+
return text
|
|
|
|
|
35 |
else:
|
36 |
+
print("๋ณธ๋ฌธ ์ฝํ
์ธ ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.")
|
37 |
return ''
|
38 |
|
39 |
|
40 |
|
41 |
+
|
42 |
def format_script(text):
|
43 |
sentences = text.split('.')
|
44 |
script = ""
|