Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -23,17 +23,20 @@ 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 |
-
if
|
31 |
-
|
32 |
-
|
33 |
-
|
34 |
-
|
|
|
|
|
|
|
35 |
else:
|
36 |
-
print("
|
37 |
return ''
|
38 |
|
39 |
|
|
|
23 |
|
24 |
def get_main_content(html_content):
|
25 |
soup = BeautifulSoup(html_content, 'html.parser')
|
26 |
+
# <meta> ํ๊ทธ์ content ์์ฑ์ ์ฐพ์ ์ถ์ถ
|
27 |
+
meta_content = []
|
28 |
+
for meta_tag in soup.find_all('meta'):
|
29 |
+
content = meta_tag.get('content')
|
30 |
+
if content:
|
31 |
+
meta_content.append(content.strip())
|
32 |
+
|
33 |
+
extracted_content = '\n'.join(meta_content)
|
34 |
+
|
35 |
+
if extracted_content:
|
36 |
+
print("์ถ์ถ๋ ๋ฉํ ์ฝํ
์ธ :", extracted_content)
|
37 |
+
return extracted_content
|
38 |
else:
|
39 |
+
print("๋ฉํ ์ฝํ
์ธ ๋ฅผ ์ฐพ์ ์ ์์ต๋๋ค.")
|
40 |
return ''
|
41 |
|
42 |
|