Closed mabodx closed 5 years ago
And this code
top_headlines = newsapi.get_top_headlines(q='bitcoin',
sources='bbc-news,the-verge',
category='business',
language='en',
country='us')
I also get error like this
Traceback (most recent call last):
File "crawler.py", line 90, in <module>
crawler.crawl()
File "crawler.py", line 69, in crawl
country='us')
File "/Users/mabodx/anaconda/lib/python3.6/site-packages/newsapi/newsapi_client.py", line 55, in get_top_headlines
raise ValueError('cannot mix country/category param with sources param.')
ValueError: cannot mix country/category param with sources param.
does python has pageSize
params?
https://newsapi.org/docs/endpoints/top-headlines
Hi,
The top headlines error is due to the mix of country and category parameters. These cannot both be arguments.
Also, for paging, please use the argument page_size
.
I follow this document https://newsapi.org/docs/client-libraries/python and test python api.
Seems like the follow code will get error I paste. sources = newsapi.get_sources()