All rights are reserved by Niteesh Kumar.. Theme images by Storman. Powered by Blogger.

Followers

Total Pageviews

Blog Archive

Follow by Email

Translate

Tuesday, 3 July 2018

Perform Google search with python script

Suppose you are working on a python project and you need to access some data from the web inside your python project. But you have no idea how to scrap that particular website data. In that case, you need to perform the google search.

As Python is famous for its capability to automate the stuff and solve bigger problems. Here we will also use some python libraries and perform the google search to get the required data. Find below step by step tutorial on how to perform the google search using Python Script-


Prerequisite - 

1- You must have Python installed on your system.

2- Install googlesearch library (pip install google-search)and webbrowser library (pip install webbrowser) on your system.

If you already have all the prerequisite then you are almost done as you only need to write few lines of code and you can run the python code to perform google search.

Follow these simple steps-

1 - Copy the code given below and save as .py file in your system.       let's say (google-search.py).

from googlesearch import*
import webbrowser
# to search
query = input()

chrome_path = "C:/Program Files (x86)/Google/Chrome/Application/chrome.exe %s"

for url in search(query, tld="co.in", num=1, stop=1, pause=2):
    webbrowser.get(chrome_path).open(url)

2 - To run this code in windows open file Python IDLE and run the program from there.



3 - when you will click on the run module it will open the command window where you need to enter the keyword you need to perform google search for - (here we have entered gmail)


4 - As soon as you will type your keyword and press enter you eill see that three tabs will open on your web browser which will be first three search result of your google search.

It will only open 3 as we have taken pause value 2. We can change this value to the number of results we want to show.

NOTE-

 Linux user can directly jump to the directory of that file and open terminal and run this command python google-search.py and input the text you want to search and you will see that 3 tabs will open on your web browser.

These three websites will be the first three google search result of our search query.



75 on: "Perform Google search with python script"
  1. You blog post is just completely quality and informative. Many new facts and information which I have not heard about before. Keep sharing more blog posts.
    python Training institute in Chennai
    python Training institute in Bangalore

    ReplyDelete
  2. Looking for the Genuine Experience Certificate with 100% Complete Verification So Contact Experienced Letter Solutions Consulting Firms Which Provide Experienced Letter with100 % Guaranteed. Contact Now- 9599119376. Or Visit Website- https://experincedletter.blogspot.com/

    ReplyDelete
  3. Looking for the Genuine Experience Certificate with 100% Complete Verification So Contact Experienced Letter Solutions Consulting Firms Which Provide Experienced Letter with100 % Guaranteed. Contact Now- 9599119376. Or Visit Website- https://experincedletter.blogspot.com/



    ReplyDelete
  4. Looking for the Genuine Experience Certificate with 100% Complete Verification So Contact Experienced Letter Solutions Consulting Firms Which Provide Experienced Letter with100 % Guaranteed. Contact Now- 9599119376. Or Visit Website- https://experincedletter.blogspot.com/


    ReplyDelete
  5. Looking for the Genuine Experience Certificate with 100% Complete Verification So Contact Experienced Letter Solutions Consulting Firms Which Provide Experienced Letter with100 % Guaranteed. Contact Now- 9599119376. Or Visit Website- https://experincedletter.blogspot.com/

    ReplyDelete
  6. you should upgrade your range of abilities in huge information in a propelled manner. ExcelR Data Science Courses

    ReplyDelete
  7. I high appreciate this post. It’s hard to find the good from the bad sometimes, but I think you’ve nailed it! would you mind updating your blog with more information? Buy Pinterest Followers

    ReplyDelete
  8. Wow its a very good post. The information provided by you is really very good and helpful for me. Keep sharing good information.

    Best Training Institute in Bangalore BTM. My Class Training Bangalore training center for certified course, learning on Software Training Course by expert faculties, also provides job placement for fresher, experience job seekers.
    Software Training Institute in Bangalore

    ReplyDelete
  9. It’s really great information for becoming a better Blogger. Keep sharing, Thanks...

    Learn Hadoop Training from the Industry Experts we bridge the gap between the need of the industry. Softgen Infotech provide the Best Hadoop Training in Bangalore with 100% Placement Assistance. Book a Free Demo Today.
    Big Data Analytics Training in Bangalore
    Tableau Training in Bangalore
    Data Science Training in Bangalore
    Workday Training in Bangalore

    ReplyDelete
  10. The article looks magnificent, but it would be beneficial if you can share more about the suchlike subjects in the future. Keep posting. 상품권 매입

    ReplyDelete
  11. I am looking for and I love to post a comment that "The content of your post is awesome" Great work!

    data science course

    ReplyDelete
  12. wonderful article. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article resolved my all queries.
    Data Science Course

    ReplyDelete
  13. I have gain a lot of information's from your Articles and Looking For more Posts...Thanks for this Information's about Python
    python training in chennai | python training in annanagar | python training in omr | python training in porur | python training in tambaram | python training in velachery

    ReplyDelete
  14. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression

    ReplyDelete
  15. I have to search sites with relevant information on given topic and provide them to teacher our opinion and the article.

    Simple Linear Regression

    Correlation vs Covariance

    ReplyDelete
  16. Very interesting to read this article.I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple linear regression
    data science interview questions

    ReplyDelete
  17. Libraries are able to support many operations like Data Scraping, NLP and other applications of machine learning. Due to such advantages and uses, students are preferring python programming tutorial rather than other languages. Also, there are many online video training courses available, user or any interested candidate can buy them from any place. unindent does not match any outer indentation level

    ReplyDelete
  18. he luxury of effective interaction and selection of tools and other accessories were vested with the clients. This type of assignments strained the budget of most of the web enterprises but still they had perforce to go in for such web development orders since they desperately wanted websites at their disposal. Jake Hackett

    ReplyDelete
  19. Amazing Article ! I would like to thank you for the efforts you had made for writing this awesome article. This article inspired me to read more. keep it up.
    Correlation vs Covariance
    Simple Linear Regression
    data science interview questions
    KNN Algorithm
    Logistic Regression explained

    ReplyDelete
  20. Very nice blogs!!! i have to learning for lot of information for this sites…Sharing for wonderful information.Thanks for sharing this valuable information to our vision. You have posted a trust worthy blog keep sharing, data sciecne course in hyderabad

    ReplyDelete
  21. Wonderful article, very useful and well explanation. Your post is extremely incredible. I will refer this to my candidates...data science courses

    ReplyDelete
  22. The study of Home Science offers openings for Careers related to: data science course in india

    ReplyDelete
  23. This was a very informative article, indeed loved to read and clear my doubts. Keep us posted a lot more blogs. Also check out our blog pages too.

    data science training in chennai

    ccna training in chennai

    iot training in chennai

    cyber security training in chennai

    ethical hacking training in chennai

    ReplyDelete
  24. Thanks for sharing your views about the concept which you know much better. Its easy to read and understand by the way you wrote the blog contents.

    python training in chennai

    ReplyDelete
  25. I feel really happy to have seen your web page and look forward to so many more entertaining times reading here. Thanks once more for all the details.

    best data science courses in chennai

    ReplyDelete
  26. Enjoyed reading the article above, really explains everything in detail, the article is very interesting and effective.

    Python Training Institute in Delhi

    ReplyDelete
  27. The best example is a lovely response from Lego, who could just reply with a "standard message" but it was so personalized and unexpected that went viral to all channels. his comment is here

    ReplyDelete
  28. Pretty good post. I just stumbled upon your blog and wanted to say that I have really enjoyed reading your blog posts. Any way I’ll be subscribing to your feed and I hope you post again soon.
    data scientist training in hyderabad

    ReplyDelete
  29. A really appreciable post thanks for sharing this post its really very helpful apart from that if anyone looking for best AutoCAD training institute in delhi Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/AutoCAD-training-courses

    ReplyDelete
  30. A really appreciable post thanks for sharing this post its really very helpful apart from that if anyone looking for best AutoCAD training institute in delhi Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/AutoCAD-training-courses

    ReplyDelete
  31. Your post is very good thanks for sharing these kind of post apart form that if anyone look for Python training institute in Delhi Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/Courses/python/python-training-institute-in-delhi

    ReplyDelete
  32. Your post is very good thanks for sharing these kind of post apart form that if anyone look for Python training institute in Delhi Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/Courses/python/python-training-institute-in-delhi

    ReplyDelete
  33. Your post is really good thanks for sharing this post and if anyone looking AutoCAD training institute in delhi Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/AutoCAD-training-courses

    ReplyDelete
  34. Big thank you for for sharing this post it's the content i looking for if anyone looking AutoCAD training institute in delhi Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/AutoCAD-training-courses

    ReplyDelete
  35. Thanks for sharing this amazing post this is the content i really looking for, it's very helpful i hope you will continue your blogging anyway if anyone looking for AutoCAD training institute in delhi contact us +91-9311002620 visit-https://www.htsindia.com/autocad-training-institute

    ReplyDelete
  36. I really love the theme on your website, I run a web site , and i would adore to use this theme. Is it a free style, or is it custom? you can purchase links from marketing1on1

    ReplyDelete
  37. Impressive blog to be honest definitely this post will inspire many more upcoming aspirants. Eventually, this makes the participants to experience and innovate themselves through knowledge wise by visiting this kind of a blog. Once again excellent job keep inspiring with your cool stuff.

    data science certification in bangalore

    ReplyDelete
  38. Thanks for posting the best information and the blog is very important.data science interview questions and answers

    ReplyDelete
  39. Big thank you for sharing this content but if anyone looking for best AutoCAD training institute in delhi look here Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/AutoCAD-training-courses

    ReplyDelete
  40. Big thank you for sharing this content but if anyone looking for best AutoCAD training institute in delhi look here Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/AutoCAD-training-courses

    ReplyDelete
  41. Very nice post thank you for sharing this post its very knowledgeable and very helpful i hope that you will continue to post these kinds of contents in future apart from that if anyone looking for Advance Excel institute in delhi so Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/Courses/business-analytics/adv-excel-training-course

    ReplyDelete
  42. Your post is really good thanks for sharing these kind of post but if anyone looking for Best Consulting Firm for Fake Experience Certificate Providers in bangalore, India with Complete Documents So Dreamsoft Consultancy is the Best Place.Further Details Here- 9599119376 or VisitWebsite-https://experiencecertificates.com/experience-certificate-provider-in-bangalore.html

    ReplyDelete
  43. Extraordinary blog filled with an amazing content which no one has touched this subject before. Thanking the blogger for all the terrific efforts put in to develop such an awesome content. Expecting to deliver similar content further too and keep sharing as always.

    data science training

    ReplyDelete
  44. Stupendous blog huge applause to the blogger and hoping you to come up with such an extraordinary content in future. Surely, this post will inspire many aspirants who are very keen in gaining the knowledge. Expecting many more contents with lot more curiosity further.

    data science certification in bhilai

    ReplyDelete
  45. Highly appreciable regarding the uniqueness of the content. This perhaps makes the readers feels excited to get stick to the subject. Certainly, the learners would thank the blogger to come up with the innovative content which keeps the readers to be up to date to stand by the competition. Once again nice blog keep it up and keep sharing the content as always.

    Data Science Course in Bhilai

    ReplyDelete
  46. Fantastic blog extremely good well enjoyed with the incredible informative content which surely activates the learners to gain the enough knowledge. Which in turn makes the readers to explore themselves and involve deeply in to the subject. Wish you to dispatch the similar content successively in future as well.

    data science training in bhilai

    ReplyDelete
  47. Anyone looking for Best Consulting Firm for Fake Experience Certificate Providers in bangalore, India with Complete Documents So Dreamsoft Consultancy is the Best Place.Further Details Here- 9599119376 or VisitWebsite-https://experiencecertificates.com/experience-certificate-provider-in-bangalore.html

    ReplyDelete
  48. Your post is really good thanks for sharing these kind of post but if anyone looking for Best Consulting Firm for Fake Experience Certificate Providers in bangalore, India with Complete Documents So Dreamsoft Consultancy is the Best Place.Further Details Here- 9599119376 or VisitWebsite-https://experiencecertificates.com/experience-certificate-provider-in-bangalore.html

    ReplyDelete
  49. Your post is really good thanks for sharing these kind of post but if anyone looking for Best Consulting Firm for Fake Experience Certificate Providers in bangalore, India with Complete Documents So Dreamsoft Consultancy is the Best Place.Further Details Here- 9599119376 or VisitWebsite-https://experiencecertificates.com/experience-certificate-provider-in-bangalore.html

    ReplyDelete
  50. Thank you for sharing this great post its very helpful but if anyone looking for Experience Certificate Providers in Noida, India with Complete Documents So Dreamsoft Consultancy is the Best Place.Further Details Here- 9599119376 or Visit Website-Website-https://experiencecertificates.com/experience-certificate-provider-in-Noida.html

    ReplyDelete
  51. Such a useful blog with required information. Thanks for sharing this amazing blog.
    AWS Certification in Chennai
    DevOps Course in Chennai

    ReplyDelete
  52. Great Work. I always follow your valuable contents. Thanks for sharing this kind of knowledge. It is very helpful and very informative and I really learned a lot from it. Further More Information About AUTOCAD Training Institute in Delhi So Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/AutoCAD-training-courses

    ReplyDelete
  53. Great Work. I always follow your valuable contents. Thanks for sharing this kind of knowledge. It is very helpful and very informative and I really learned a lot from it. Further More Information About AUTOCAD Training Institute in Delhi So Contact Here-+91-9311002620 Or Visit Website- https://www.htsindia.com/AutoCAD-training-courses

    ReplyDelete
  54. Big thank you for sharing this content If anyone looking for best Sas training institute in Delhi Contact Here-+91-9311002620 Or Visit our website https://www.htsindia.com/Courses/business-analytics/sas-training-institute-in-delhi

    ReplyDelete
  55. Thanks for posting these kinds of post its very helpful and very good content a really appreciable post apart from that if anyone looking for Tally course training institute in delhi so contact here +91-9311002620 visit https://www.htsindia.com/Courses/tally/tally-training-course

    ReplyDelete
  56. Thanks for posting these kinds of post its very helpful and very good content a really appreciable post apart from that if anyone looking for Tally course training institute in delhi so contact here +91-9311002620 visit https://www.htsindia.com/Courses/tally/tally-training-course

    ReplyDelete
  57. I recently came across your article and have been reading along. I want to express my admiration of your writing skills. These kind of posts really helpful to gain the knowledge of unknown things

    Data Science Training in Hyderabad

    ReplyDelete
  58. Your post is really good thanks for sharing these kind of post but if anyone looking for Best Consulting Firm for Fake Experience Certificate Providers in pune, India with Complete Documents So Dreamsoft Consultancy is the Best Place.Further Details Here- 9599119376 or VisitWebsite-https://experiencecertificates.com/experience-certificate-provider-in-pune.html

    ReplyDelete
  59. Your post is really good thanks for sharing these kind of post but if anyone looking for Best Consulting Firm for Fake Experience Certificate Providers in pune, India with Complete Documents So Dreamsoft Consultancy is the Best Place.Further Details Here- 9599119376 or VisitWebsite-https://experiencecertificates.com/experience-certificate-provider-in-pune.html

    ReplyDelete