Skip to content

Commit c48ad04

Browse files
committed
Added Google Search Script
1 parent 6262fec commit c48ad04

File tree

3 files changed

+40
-0
lines changed

3 files changed

+40
-0
lines changed

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,3 +119,4 @@ SR No | Project | Author
119119
2 | [Pycon Proposals Scraper](https://github.com/Python-World/Python_and_the_Web/tree/master/Scripts/Web_Scrappers/Pycon_Proposals)| [Aditya Jetely](https://github.com/AdityaJ7)
120120
3 | [Hacktoberfest Events Scraper](https://github.com/Python-World/Python_and_the_Web/tree/master/Scripts/Web_Scrappers/Hacktoberfest_Events)| [Aditya Jetely](https://github.com/AdityaJ7)
121121
4 | [Wifi Speed Tester](https://github.com/Python-World/Python_and_the_Web/tree/master/Scripts/Miscellaneous/Wifi_Speed)| [AdeshChoudhar19](https://github.com/AdeshChoudhar19)
122+
5 | [Google Search Using Python](https://github.com/Python-World/Python_and_the_Web/tree/master/Scripts/Miscellaneous/Wifi_Speed)| [Naman Jain](https://github.com/nj1902)
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<h1 align = center> GOOGLE SEARCH </h1>
2+
3+
> To install the google module, we can use the pip package installer.
4+
5+
```
6+
pip install google
7+
```
8+
9+
> We are using search() function from the googlesearch module.
10+
```
11+
search(query, tld='co.in', lang='en', num=10, start=0, stop=None, pause=2)
12+
```
13+
## Function Description
14+
>> **query**: This is the text that you want to search for.<br/>
15+
>> **tld**: This refers to the top level domain value like co.in or com which will specify which Google website we want to use.<br/>
16+
>> **lang**: This parameter stands for language.<br/>
17+
>> **num**: This is used to specify the number of results we want.<br/>
18+
>> **start**: This is to specify from where to start the results. We should keep it 0 to begin from the very start.<br/>
19+
>> **stop**: The last result to retrieve. Use None to keep searching forever.<br/>
20+
>> **pause**: This parameter is used to specify the number of seconds to pause between consecutive HTTP requests because if we hit too many requests, Google can block our IP address.
21+
22+
## Contributor ✨
23+
24+
<table>
25+
<tr>
26+
<td align="center"><a href="https://github.com/nj1902"><img src="" width="200px;" alt=""/><sub><b>💻 Naman Jain 💻</b></sub></a><br /></td>
27+
28+
29+
</table>
30+
31+
<!-- markdownlint-enable -->
32+
<!-- prettier-ignore-end -->
33+
<!-- ALL-CONTRIBUTORS-LIST:END -->
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
from googlesearch import search
2+
3+
query = input()
4+
5+
for item in search(query, tld = "co.in", num=10, stop = 10, pause = 2):
6+
print(item)

0 commit comments

Comments
 (0)