我试图通过newyorktimes
库检索Python上的参数web_url
。但是,python上的查询结果要比nytapi的结果小得多。在
这是我的代码:
from nytimesarticle import articleAPI
api = articleAPI("*Your Key*")
articles = api.search( q = 'terrorist attack')
print(articles['response'],['docs'],['web_url'])
Tags:
尝试
@GET("{duration}.json") Call<MostPopularData> getMostPopularArticles(@Path("duration") int duration, @Query("api-key") String apiKey, @Query("offset") int offset);
偏移量必须为正且为20的倍数。在
缺少分页,请尝试以下操作:
现在,您可以继续递增
page
并获得更多文章。它被礼貌地称为RTFM nytimesarticle。在相关问题 更多 >
编程相关推荐