【发布时间】:2020-02-16 13:32:34
【问题描述】:
我使用的是 Python 3.X,带有 NewsAPI.org 的 API。我希望能够从关键字列表中找到具有关键字的新闻文章。我尝试将逗号放在 NewsAPI 网址的关键字部分,但这只会返回包含所有提到的关键字的文章。 这是我的代码:
url = ('https://newsapi.org/v2/everything?'
'q=Google, Apple, Microsoft&'
'sortBy=popularity&'
'apiKey=API_KEY')
parser = html.parser.HTMLParser()
response = requests.get(url)
【问题讨论】:
标签: python python-3.x api pypi