Skip to content

Commit 1ecf8dd

Browse files
authored
Create google-search-automatic.py
1 parent 2763386 commit 1ecf8dd

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
"""
2+
This script can automatically perform the google search process and open the website in default web browser.
3+
"""
4+
5+
from googlesearch import search
6+
from webbrowser import open
7+
8+
9+
def google_search(query, no_of_results):
10+
11+
result = search(query, num=no_of_results, pause=2, stop=no_of_results)
12+
13+
return result
14+
15+
16+
if __name__ == "__main__":
17+
18+
query = input("Enter the Query: ")
19+
no_of_results = int(input("Enter number of tabs open in browser: "))
20+
for i in google_search(query, no_of_results):
21+
open(i)

0 commit comments

Comments
 (0)