Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,7 +17,10 @@ for news_item in soup.select('div.rankingnews_box ul.rankingnews_list li'):
|
|
17 |
title = news_item.find('a', class_='list_title').text.strip()
|
18 |
link = news_item.find('a', class_='list_title')['href']
|
19 |
time = news_item.find('span', class_='list_time').text.strip()
|
20 |
-
|
|
|
|
|
|
|
21 |
|
22 |
news_list.append({
|
23 |
'Rank': rank,
|
|
|
17 |
title = news_item.find('a', class_='list_title').text.strip()
|
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,
|