Nv7-GitHub / googlesearch

A Python library for scraping the Google search engine.
https://pypi.org/project/googlesearch-python/
MIT License
480 stars 117 forks source link

search result in variable #38

Closed VarunBanka closed 2 years ago

VarunBanka commented 2 years ago

in which variable does this module stores final search result ?

Themis3000 commented 2 years ago

You define what variable you want it stored in. search() simply returns the final search results, assign that value to a variable like this:

(results can be called anything else you'd like) results = search("test search")

If you'd like the results in a list use list() like this: results = list(search("test search"))

VarunBanka commented 2 years ago

You define what variable you want it stored in. search() simply returns the final search results, assign that value to a variable like this:

(results can be called anything else you'd like) results = search("test search")

If you'd like the results in a list use list() like this: results = list(search("test search"))

So can I do like this? print(results) ? If no then how ? I'm making a chat bot with voice support so for that I need.......

Themis3000 commented 2 years ago

That's correct, if you do results = list(search("test search")) then you can also do print(results), that's correct

VarunBanka commented 2 years ago

That's correct, if you do results = list(search("test search")) then you can also do print(results), that's correct

okay, thanks