Comments (4)
I found this problem too when I want to get specific keywords, but I found that something interesting, you can slightly lower the range of the date because at the first attempt I found a NoneType problem too.
My suggestion is lowering the range of date, maybe just for 1-2 days and one keyword first, and then you can increasing step by step.
from GoogleNews import GoogleNews
googlenews = GoogleNews()googlenews = GoogleNews(start='17/02/2021',end='22/02/2021')
news_keywords = ["Apple","Microsoft"etc]
check = ['17/02/2021','18/02/2021','19/02/2021','20/02/2021','21/02/2021','22/02/2021']
cols =['Date','Title','Description','provider','company']
lst = []
for i in news_keywords:
print(i)
googlenews.search(i)
googlenews.get_page(1)
googlenews.get_page(2)
etccurrently returns
Apple
'NoneType' object is not iterable
'NoneType' object is not iterable
'NoneType' object is not iterablefor multiple companies over this time period.
Have ran the same code for each week over the past months so unsure if mabye im doing something wrong with latest update?
from googlenews.
hmm, needing data for the past week so this doesn't necessarily fix my problem, but thanks for your suggestion
from googlenews.
Likewise I have found the same
'NoneType' object is not iterable
from googlenews.
There are few mistakes in your code, you only need to create constructor once, and the date format should be mm/dd/yyyy, and the result should be retrieved by googlenews.results()
, and please add delay few seconds within the loop, if you request too frequent, Google may block your IP. The return list should be something like [{'title':'xxx','media':'xxx','date':'xxx','datetime':'xxx','desc':'xxx','link':'xxx','img':'xxx'},{...}...]
from GoogleNews import GoogleNews
- googlenews = GoogleNews()
- (it is not necessary here, it will be reset by the next line)
- googlenews = GoogleNews(start='17/02/2021',end='22/02/2021')
+ googlenews = GoogleNews(start='02/17/2021',end='02/22/2021')
...
googlenews.search(i)
googlenews.get_page(1)
googlenews.get_page(2)
+ result = googlenews.results()
+ time.sleep(5)
from googlenews.
Related Issues (20)
- googlenews.search not working HOT 2
- en-GB search for region and language. HOT 1
- GoogleNews search is not working, please help HOT 11
- .search() does not take into account time range, gives limited number of results HOT 1
- googlenews.search() giving empty results and desc is returning None HOT 1
- Fetching doesnt work since 2 days HOT 4
- Empty news result
- 'desc' key in results list empty for all searches
- if I can use proxy in this tools HOT 2
- 429 error HOT 1
- 'get_news' search function returns NoneType error HOT 3
- get_news() search returning 'NoneType' error HOT 3
- no results return HOT 2
- Title resturns the media name in front HOT 2
- Intermediate URL redirect HOT 5
- Date Range doesn't work? HOT 1
- Pt-br version is not working HOT 1
- No results returned 1.6.14 HOT 1
- Datetime not available HOT 1
- Result for all search returning "None"
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from googlenews.