Python module introduction-google search engine python Interface

Source: Internet
Author: User
Tags html interpreter tld

Introduction

The google module is a python interface of the google search engine. It uses urllib2 to search on google and BeautifulSoup to explain external encapsulation. It is not an official google interface.

Function: Google search engine python interface type: External module current version: 1.0.5 (view date ):? Https://pypi.python.org/pypi/google monthly downloads: around 10 thousand platform: cross-platform related modules: BeautifulSoup? It is strongly recommended that an html interpreter be downloaded for about 0.2 million characters per month.

Installation Method:

# tar xzvf setuptools-2.0.tar.gz# cd setuptools-2.0# python setup.py install# easy_install pip# pip install BeautifulSoup# pip install google
Use
>>> from google import search>>> for url in search('python', tld='com.hk', lang='cn', stop=2):...     print(url)... http://www.python.org/http://www.python.org/getit/http://www.python.org/doc/http://www.python.org/getit/releases/3.3.2/http://www.python.org/getit/releases/2.7.5/http://zh.wikipedia.org/zh-hk/Pythonhttp://zh.wikipedia.org/wiki/PyPyhttp://zh.wikipedia.org/wiki/%E5%8D%B3%E6%99%82%E7%B7%A8%E8%AD%AFhttp://zh.wikipedia.org/wiki/%E5%90%89%E5%A4%9A%C2%B7%E8%8C%83%E7%BD%97%E8%8B%8F%E5%A7%86http://zh.wikipedia.org/wiki/CPythonhttp://en.wikipedia.org/wiki/Python_(programming_language)http://python.org.tw/http://en.wikipedia.org/wiki/Burmese_pythonhttp://en.wikipedia.org/wiki/Python_regiushttp://news.nationalgeographic.com/news/2005/10/1006_051006_pythoneatsgator.htmlhttp://www.animalpeoplenews.org/anp/2013/10/26/alligators-pigs-pythons-the-reptilian-ploy-to-resuscitate-sport-hunting/http://kidfocused.com/mom-wakes-to-python-wrapped-around-toddler/http://www.codecademy.com/tracks/pythonhttp://openhome.cc/Gossip/Python/http://pythonline.com/http://learnpythonthehardway.org/book/http://www.learnpython.org/

Search (query, tld = 'com', lang = 'en', num = 10, start = 0, stop = None, pause = 2.0): search string query using Google. The returned result is a generator. The parameters are as follows:

Delete the following parts. For more information, see the original address below.
At http://automationtesting.sinaapp.com/blog/m_googlereference? Https://pypi.python.org/pypi/google

?


Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.