duwing commited on
Commit
73b9bd4
·
verified ·
1 Parent(s): 6c0af57

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +4 -4
app.py CHANGED
@@ -93,10 +93,10 @@ def get_comments(news_url):
93
  soup = BeautifulSoup(response.text, "html.parser")
94
 
95
  # 제목 추출
96
- title = article_soup.select_one("#ct > div.media_end_head.go_trans > div.media_end_head_title > h2")
97
- if title is None:
98
- title = article_soup.select_one("#content > div.end_ct > div > h2")
99
-
100
  # 본문 추출
101
  content = article_soup.select_one("#dic_area")
102
  if content is None:
 
93
  soup = BeautifulSoup(response.text, "html.parser")
94
 
95
  # 제목 추출
96
+ title = article_soup.select_one("#ct > div.media_end_head.go_trans > div.media_end_head_title > h2")
97
+ if title is None:
98
+ title = article_soup.select_one("#content > div.end_ct > div > h2")
99
+
100
  # 본문 추출
101
  content = article_soup.select_one("#dic_area")
102
  if content is None: