新闻列表 (News List)
通过分页浏览 vlr.gg 上的新闻文章列表。
news() 返回 vlr.gg 网站上分页的新闻资讯列表。
函数签名
news(
page: int = 1,
) -> NewsPage参数
Prop
Type
返回值 - NewsPage
Prop
Type
News 字段说明
Prop
Type
示例
获取最新新闻
import vlrdevapi
result = vlrdevapi.news(page=1)
print(f"当前页新闻数量: {len(result.news)}")
print(f"是否有下一页: {result.has_next_page}")
for item in result.news:
print(f"{item.date.date()} | {item.title} | 作者: {item.author}")按国家/地区筛选新闻
import vlrdevapi
result = vlrdevapi.news(page=1)
local_news = [n for n in result.news if n.country_name == "China"]
if local_news:
for n in local_news:
print(f"{n.title} - {n.author}")
else:
print("当前页暂无中国相关的新闻。")最后更新于