Update app.py
Browse files
app.py
CHANGED
@@ -113,8 +113,8 @@ def get_base_url(board_select):
|
|
113 |
"๋ง์ด๋ฒ ๋ฒ ": "https://cafe.naver.com/ArticleList.nhn?search.clubid=29434212&search.menuid=2&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=29434212",
|
114 |
"๋ง์คํ๋ฆญ": "https://cafe.naver.com/ArticleList.nhn?search.clubid=10094499&search.menuid=599&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=10094499",
|
115 |
"๊ด์ฃผ๋ง": "https://cafe.naver.com/ArticleList.nhn?search.clubid=26025763&search.menuid=508&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=26025763",
|
116 |
-
|
117 |
-
|
118 |
"์งํฌ๋ง": "https://cafe.naver.com/ArticleList.nhn?search.clubid=21442290&search.menuid=476&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=21442290"
|
119 |
}
|
120 |
selected_url = urls.get(board_select)
|
@@ -156,7 +156,7 @@ def extract_data_to_excel_and_html(page, board_select):
|
|
156 |
# Excel ์คํ์ผ ์ ์
|
157 |
header_format = workbook.add_format({
|
158 |
'bold': True,
|
159 |
-
'align': 'center',
|
160 |
'valign': 'vcenter',
|
161 |
'bg_color': '#f8f9fa',
|
162 |
'border': 1
|
@@ -172,7 +172,7 @@ def extract_data_to_excel_and_html(page, board_select):
|
|
172 |
'align': 'left',
|
173 |
'valign': 'vcenter',
|
174 |
'border': 1,
|
175 |
-
'
|
176 |
'underline': True
|
177 |
})
|
178 |
|
@@ -214,7 +214,7 @@ def extract_data_to_excel_and_html(page, board_select):
|
|
214 |
padding: 12px 8px;
|
215 |
font-weight: 600;
|
216 |
vertical-align: middle;
|
217 |
-
text-align: center !important;
|
218 |
}
|
219 |
.crawl-table td {
|
220 |
border: 1px solid #dee2e6;
|
@@ -222,13 +222,13 @@ def extract_data_to_excel_and_html(page, board_select):
|
|
222 |
line-height: 1.4;
|
223 |
}
|
224 |
.crawl-table td:first-child {
|
225 |
-
text-align: left;
|
226 |
}
|
227 |
.crawl-table td:nth-child(2),
|
228 |
.crawl-table td:nth-child(3),
|
229 |
.crawl-table td:nth-child(4),
|
230 |
.crawl-table td:nth-child(5) {
|
231 |
-
text-align: right;
|
232 |
}
|
233 |
.crawl-table td:first-child a {
|
234 |
text-decoration: none;
|
@@ -379,7 +379,6 @@ css = """
|
|
379 |
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24) !important;
|
380 |
border-radius: 12px !important;
|
381 |
}
|
382 |
-
|
383 |
/* ์ ๋ชฉ ์คํ์ผ๋ง */
|
384 |
h1 {
|
385 |
font-size: 2.2rem !important;
|
@@ -390,7 +389,6 @@ h1 {
|
|
390 |
padding-bottom: 1.5rem !important;
|
391 |
border-bottom: 2px solid #000000 !important;
|
392 |
}
|
393 |
-
|
394 |
/* ์ค๋ช
ํ
์คํธ ์คํ์ผ๋ง */
|
395 |
.gr-markdown {
|
396 |
text-align: center !important;
|
@@ -398,7 +396,6 @@ h1 {
|
|
398 |
font-size: 1rem !important;
|
399 |
margin-bottom: 2rem !important;
|
400 |
}
|
401 |
-
|
402 |
/* ๋ผ๋์ค ๋ฒํผ ๊ทธ๋ฃน ์คํ์ผ๋ง */
|
403 |
.gr-form {
|
404 |
background-color: #f8f8f8 !important;
|
@@ -406,26 +403,22 @@ h1 {
|
|
406 |
border-radius: 8px !important;
|
407 |
margin-bottom: 1.5rem !important;
|
408 |
}
|
409 |
-
|
410 |
.gr-radio-row {
|
411 |
display: grid !important;
|
412 |
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
|
413 |
gap: 1rem !important;
|
414 |
padding: 1rem !important;
|
415 |
}
|
416 |
-
|
417 |
.gr-radio {
|
418 |
border: 2px solid #000000 !important;
|
419 |
padding: 0.8rem !important;
|
420 |
border-radius: 6px !important;
|
421 |
transition: all 0.3s ease !important;
|
422 |
}
|
423 |
-
|
424 |
.gr-radio:checked {
|
425 |
background-color: #000000 !important;
|
426 |
color: #ffffff !important;
|
427 |
}
|
428 |
-
|
429 |
/* ์ซ์ ์
๋ ฅ ํ๋ ์คํ์ผ๋ง */
|
430 |
.gr-number-input {
|
431 |
border: 2px solid #000000 !important;
|
@@ -436,7 +429,6 @@ h1 {
|
|
436 |
max-width: 300px !important;
|
437 |
margin: 0 auto !important;
|
438 |
}
|
439 |
-
|
440 |
/* ์ํ ํ
์คํธ๋ฐ์ค ์คํ์ผ๋ง */
|
441 |
.gr-textbox {
|
442 |
background-color: #f8f8f8 !important;
|
@@ -446,7 +438,6 @@ h1 {
|
|
446 |
margin: 1rem 0 !important;
|
447 |
font-size: 0.95rem !important;
|
448 |
}
|
449 |
-
|
450 |
/* ์์ง ๋ฒํผ ์คํ์ผ๋ง */
|
451 |
.gr-button {
|
452 |
background-color: #000000 !important;
|
@@ -462,13 +453,11 @@ h1 {
|
|
462 |
display: block !important;
|
463 |
transition: all 0.3s ease !important;
|
464 |
}
|
465 |
-
|
466 |
.gr-button:hover {
|
467 |
background-color: #333333 !important;
|
468 |
transform: translateY(-2px) !important;
|
469 |
box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
|
470 |
}
|
471 |
-
|
472 |
/* ํ์ผ ๋ค์ด๋ก๋ ์์ญ ์คํ์ผ๋ง */
|
473 |
.gr-file {
|
474 |
border: 2px dashed #000000 !important;
|
@@ -478,7 +467,6 @@ h1 {
|
|
478 |
background-color: #f8f8f8 !important;
|
479 |
margin-top: 2rem !important;
|
480 |
}
|
481 |
-
|
482 |
/* HTML ๊ฒฐ๊ณผ ํ
์ด๋ธ ์คํ์ผ๋ง */
|
483 |
table {
|
484 |
width: 100% !important;
|
@@ -488,25 +476,21 @@ table {
|
|
488 |
overflow: hidden !important;
|
489 |
box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
|
490 |
}
|
491 |
-
|
492 |
th {
|
493 |
background-color: #000000 !important;
|
494 |
color: #ffffff !important;
|
495 |
padding: 1rem !important;
|
496 |
-
text-align: center !important;
|
497 |
font-weight: 600 !important;
|
498 |
}
|
499 |
-
|
500 |
td {
|
501 |
padding: 0.8rem !important;
|
502 |
border-bottom: 1px solid #e0e0e0 !important;
|
503 |
color: #333333 !important;
|
504 |
}
|
505 |
-
|
506 |
tr:hover {
|
507 |
background-color: #f5f5f5 !important;
|
508 |
}
|
509 |
-
|
510 |
/* ๋ฐ์ํ ๋์์ธ */
|
511 |
@media (max-width: 768px) {
|
512 |
.gradio-container {
|
@@ -565,4 +549,4 @@ with gr.Blocks(css=css) as demo:
|
|
565 |
)
|
566 |
|
567 |
if __name__ == "__main__":
|
568 |
-
demo.launch()
|
|
|
113 |
"๋ง์ด๋ฒ ๋ฒ ": "https://cafe.naver.com/ArticleList.nhn?search.clubid=29434212&search.menuid=2&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=29434212",
|
114 |
"๋ง์คํ๋ฆญ": "https://cafe.naver.com/ArticleList.nhn?search.clubid=10094499&search.menuid=599&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=10094499",
|
115 |
"๊ด์ฃผ๋ง": "https://cafe.naver.com/ArticleList.nhn?search.clubid=26025763&search.menuid=508&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=26025763",
|
116 |
+
"์ผํ์ง๋ฆ์ ": "https://cafe.naver.com/ArticleList.nhn?search.clubid=25729954&search.menuid=751&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=25729954",
|
117 |
+
"๋ถ์ฐ๋ง": "https://cafe.naver.com/ArticleList.nhn?search.clubid=28707025&search.menuid=282&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=28707025",
|
118 |
"์งํฌ๋ง": "https://cafe.naver.com/ArticleList.nhn?search.clubid=21442290&search.menuid=476&search.boardtype=L&userDisplay=50&search.specialmenutype=&search.totalCount=501&search.cafeId=21442290"
|
119 |
}
|
120 |
selected_url = urls.get(board_select)
|
|
|
156 |
# Excel ์คํ์ผ ์ ์
|
157 |
header_format = workbook.add_format({
|
158 |
'bold': True,
|
159 |
+
'align': 'center',
|
160 |
'valign': 'vcenter',
|
161 |
'bg_color': '#f8f9fa',
|
162 |
'border': 1
|
|
|
172 |
'align': 'left',
|
173 |
'valign': 'vcenter',
|
174 |
'border': 1,
|
175 |
+
'font_color': '#0066cc', # ์์ : 'color' -> 'font_color'
|
176 |
'underline': True
|
177 |
})
|
178 |
|
|
|
214 |
padding: 12px 8px;
|
215 |
font-weight: 600;
|
216 |
vertical-align: middle;
|
217 |
+
text-align: center !important;
|
218 |
}
|
219 |
.crawl-table td {
|
220 |
border: 1px solid #dee2e6;
|
|
|
222 |
line-height: 1.4;
|
223 |
}
|
224 |
.crawl-table td:first-child {
|
225 |
+
text-align: left;
|
226 |
}
|
227 |
.crawl-table td:nth-child(2),
|
228 |
.crawl-table td:nth-child(3),
|
229 |
.crawl-table td:nth-child(4),
|
230 |
.crawl-table td:nth-child(5) {
|
231 |
+
text-align: right;
|
232 |
}
|
233 |
.crawl-table td:first-child a {
|
234 |
text-decoration: none;
|
|
|
379 |
box-shadow: 0 1px 3px rgba(0,0,0,0.12), 0 1px 2px rgba(0,0,0,0.24) !important;
|
380 |
border-radius: 12px !important;
|
381 |
}
|
|
|
382 |
/* ์ ๋ชฉ ์คํ์ผ๋ง */
|
383 |
h1 {
|
384 |
font-size: 2.2rem !important;
|
|
|
389 |
padding-bottom: 1.5rem !important;
|
390 |
border-bottom: 2px solid #000000 !important;
|
391 |
}
|
|
|
392 |
/* ์ค๋ช
ํ
์คํธ ์คํ์ผ๋ง */
|
393 |
.gr-markdown {
|
394 |
text-align: center !important;
|
|
|
396 |
font-size: 1rem !important;
|
397 |
margin-bottom: 2rem !important;
|
398 |
}
|
|
|
399 |
/* ๋ผ๋์ค ๋ฒํผ ๊ทธ๋ฃน ์คํ์ผ๋ง */
|
400 |
.gr-form {
|
401 |
background-color: #f8f8f8 !important;
|
|
|
403 |
border-radius: 8px !important;
|
404 |
margin-bottom: 1.5rem !important;
|
405 |
}
|
|
|
406 |
.gr-radio-row {
|
407 |
display: grid !important;
|
408 |
grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)) !important;
|
409 |
gap: 1rem !important;
|
410 |
padding: 1rem !important;
|
411 |
}
|
|
|
412 |
.gr-radio {
|
413 |
border: 2px solid #000000 !important;
|
414 |
padding: 0.8rem !important;
|
415 |
border-radius: 6px !important;
|
416 |
transition: all 0.3s ease !important;
|
417 |
}
|
|
|
418 |
.gr-radio:checked {
|
419 |
background-color: #000000 !important;
|
420 |
color: #ffffff !important;
|
421 |
}
|
|
|
422 |
/* ์ซ์ ์
๋ ฅ ํ๋ ์คํ์ผ๋ง */
|
423 |
.gr-number-input {
|
424 |
border: 2px solid #000000 !important;
|
|
|
429 |
max-width: 300px !important;
|
430 |
margin: 0 auto !important;
|
431 |
}
|
|
|
432 |
/* ์ํ ํ
์คํธ๋ฐ์ค ์คํ์ผ๋ง */
|
433 |
.gr-textbox {
|
434 |
background-color: #f8f8f8 !important;
|
|
|
438 |
margin: 1rem 0 !important;
|
439 |
font-size: 0.95rem !important;
|
440 |
}
|
|
|
441 |
/* ์์ง ๋ฒํผ ์คํ์ผ๋ง */
|
442 |
.gr-button {
|
443 |
background-color: #000000 !important;
|
|
|
453 |
display: block !important;
|
454 |
transition: all 0.3s ease !important;
|
455 |
}
|
|
|
456 |
.gr-button:hover {
|
457 |
background-color: #333333 !important;
|
458 |
transform: translateY(-2px) !important;
|
459 |
box-shadow: 0 4px 6px rgba(0,0,0,0.1) !important;
|
460 |
}
|
|
|
461 |
/* ํ์ผ ๋ค์ด๋ก๋ ์์ญ ์คํ์ผ๋ง */
|
462 |
.gr-file {
|
463 |
border: 2px dashed #000000 !important;
|
|
|
467 |
background-color: #f8f8f8 !important;
|
468 |
margin-top: 2rem !important;
|
469 |
}
|
|
|
470 |
/* HTML ๊ฒฐ๊ณผ ํ
์ด๋ธ ์คํ์ผ๋ง */
|
471 |
table {
|
472 |
width: 100% !important;
|
|
|
476 |
overflow: hidden !important;
|
477 |
box-shadow: 0 1px 3px rgba(0,0,0,0.12) !important;
|
478 |
}
|
|
|
479 |
th {
|
480 |
background-color: #000000 !important;
|
481 |
color: #ffffff !important;
|
482 |
padding: 1rem !important;
|
483 |
+
text-align: center !important;
|
484 |
font-weight: 600 !important;
|
485 |
}
|
|
|
486 |
td {
|
487 |
padding: 0.8rem !important;
|
488 |
border-bottom: 1px solid #e0e0e0 !important;
|
489 |
color: #333333 !important;
|
490 |
}
|
|
|
491 |
tr:hover {
|
492 |
background-color: #f5f5f5 !important;
|
493 |
}
|
|
|
494 |
/* ๋ฐ์ํ ๋์์ธ */
|
495 |
@media (max-width: 768px) {
|
496 |
.gradio-container {
|
|
|
549 |
)
|
550 |
|
551 |
if __name__ == "__main__":
|
552 |
+
demo.launch()
|