0

I use the following code to get a list of websites from the google search.

However, I need to return the search result for the last month

from googlesearch import search

for result in search('searched word',tld = 'com', stop = 10):
    print(result)

1 Answers1

1

I know at least 3 libs for Python that makes google search, but none of them include a 'timed search'. Instead, i suggest to follow istructions in this post.

You have only to add one more key to query, which is represented by '&tbs=qdr:X'. X is related to the timing that you need.

Example: "https://www.google.com/search?q=StackOverflow&tbs=qdr:h". (Will search last hour).

In the case you're asking for, it will be:"https://www.google.com/search?q=StackOverflow&tbs=qdr:m".

Following a list of all options:

tbs=qdr:h (Last hour)
tbs=qdr:d (Last 24 hours)
tbs=qdr:w (Last week)
tbs=qdr:m (Last month)
tbs=qdr:y (Last year)