1

This code, according to "geeksforgeeks" should return 10 results however for me it is only returning one. Any thoughts?

try: 
    from googlesearch import search 
except ImportError: 
    print("No module named 'google' found") 

query = "dogs"

for j in search(query, tld="co.in", num=10, stop=1, pause=2): 
    print(j) 
4

1 Answer 1

2

I'm assuming you are using this library:

https://github.com/MarioVilas/googlesearch

According to its documentation, you are misunderstanding what the function arguments mean.

  • num (int) – Number of results per page

  • stop (int) – Last result to retrieve. Use None to keep searching forever.

By using stop=1 you only get one result. Change it to something higher.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.