Spaces:
Running
Running
Update app.py
Browse files
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 |
-
|
|
|
|
|
|
|
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,
|