CSB261 commited on
Commit
b92961a
โ€ข
1 Parent(s): 7ff16ac

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -18,9 +18,12 @@ for news_item in soup.select('div.rankingnews_box ul.rankingnews_list li'):
18
  link = news_item.find('a', class_='list_title')['href']
19
  time = news_item.find('span', class_='list_time').text.strip()
20
 
21
- # ์ด๋ฏธ์ง€๊ฐ€ ์žˆ๋Š”์ง€ ํ™•์ธ
22
  img_tag = news_item.find('img')
23
- image_url = img_tag['src'] if img_tag else 'No Image Available'
 
 
 
24
 
25
  news_list.append({
26
  'Rank': rank,
 
18
  link = news_item.find('a', class_='list_title')['href']
19
  time = news_item.find('span', class_='list_time').text.strip()
20
 
21
+ # ์ด๋ฏธ์ง€ ํƒœ๊ทธ์™€ src ์†์„ฑ ํ™•์ธ
22
  img_tag = news_item.find('img')
23
+ if img_tag and 'src' in img_tag.attrs:
24
+ image_url = img_tag['src']
25
+ else:
26
+ image_url = 'No Image Available'
27
 
28
  news_list.append({
29
  'Rank': rank,