Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google search using python script [closed]

Tags:

python

Could anyone help me on how to write a python script that searches google and prints the links of top results.

like image 293
sudh Avatar asked Oct 10 '10 01:10

sudh


People also ask

Does Google search engine use Python?

Python has been an important part of Google from the company's beginning. Python is recognized as an official language at Google, it is one of the key languages at Google today, alongside with C++ and Java.

How do you make a search engine like Google in Python?

Create a file urls.py in the engine folder. Append the following lines. Our project is now done , to fire it up type python3 manage.py runserver enter this url in your browser and you should see this. Now enter your query in the search bar and your should get your results like this.


1 Answers

Try this, its very simple to use: https://pypi.python.org/pypi/google

Docs: https://breakingcode.wordpress.com/2010/06/29/google-search-python/

Github: https://github.com/MarioVilas/google

Install this python package and usage is as simple as this:

# Get the first 5 hits for "google 1.9.1 python" in Google Pakistan from google import search  for url in search('google 1.9.1 python', tld='com.pk', lang='es', stop=5):     print(url) 
like image 95
Mansoor Akram Avatar answered Sep 29 '22 13:09

Mansoor Akram