Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -3,7 +3,8 @@ import re
|
|
3 |
import requests
|
4 |
from bs4 import BeautifulSoup
|
5 |
|
6 |
-
def extract_pdf_links(
|
|
|
7 |
response = requests.get(url)
|
8 |
soup = BeautifulSoup(response.text, 'html.parser')
|
9 |
|
@@ -20,14 +21,14 @@ def generate_html(pdf_links):
|
|
20 |
html += f'<a href="{link}" target="_blank" download>{link}</a><br/>'
|
21 |
return html
|
22 |
|
23 |
-
def extract_and_download(
|
24 |
-
pdf_links = extract_pdf_links(
|
25 |
return generate_html(pdf_links)
|
26 |
|
27 |
-
title = "네이버 증권 리서치
|
28 |
|
29 |
iface = gr.Interface(extract_and_download,
|
30 |
-
inputs=
|
31 |
outputs="html",
|
32 |
title=title)
|
33 |
|
|
|
3 |
import requests
|
4 |
from bs4 import BeautifulSoup
|
5 |
|
6 |
+
def extract_pdf_links():
|
7 |
+
url = 'https://finance.naver.com/research/company_list.naver'
|
8 |
response = requests.get(url)
|
9 |
soup = BeautifulSoup(response.text, 'html.parser')
|
10 |
|
|
|
21 |
html += f'<a href="{link}" target="_blank" download>{link}</a><br/>'
|
22 |
return html
|
23 |
|
24 |
+
def extract_and_download():
|
25 |
+
pdf_links = extract_pdf_links()
|
26 |
return generate_html(pdf_links)
|
27 |
|
28 |
+
title = "네이버 증권 리서치 PDF 다운로드"
|
29 |
|
30 |
iface = gr.Interface(extract_and_download,
|
31 |
+
inputs=[],
|
32 |
outputs="html",
|
33 |
title=title)
|
34 |
|