python模块介绍- google 谷歌搜索引擎python接口
python模块介绍- google 谷歌搜索引擎python接口
简介
google 模块是谷歌搜索引擎python接口,系用urllib2在google上进行搜索,使用BeautifulSoup进行解释外部封装,非google官方接口。
功能:谷歌搜索引擎python接口 类型:外部模块当前版本:1.0.5(查看日期2013-12-22)下载地址: ?https://pypi.python.org/pypi/google 月下载量:1万左右平台:跨平台相关模块: BeautifulSoup? 一个html解释器 月下载20万左右 强烈推荐安装方法:
# tar xzvf setuptools-2.0.tar.gz # cd setuptools-2.0 # python setup.py install # easy_install pip # pip install BeautifulSoup # pip install google
使用
>>> 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/Python http://zh.wikipedia.org/wiki/PyPy http://zh.wikipedia.org/wiki/%E5%8D%B3%E6%99%82%E7%B7%A8%E8%AD%AF http://zh.wikipedia.org/wiki/%E5%90%89%E5%A4%9A%C2%B7%E8%8C%83%E7%BD%97%E8%8B%8F%E5%A7%86 http://zh.wikipedia.org/wiki/CPython http://en.wikipedia.org/wiki/Python_(programming_language) http://python.org.tw/ http://en.wikipedia.org/wiki/Burmese_python http://en.wikipedia.org/wiki/Python_regius http://news.nationalgeographic.com/news/2005/10/1006_051006_pythoneatsgator.html http://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/python http://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): 使用谷歌搜索字符串query。返回结果为生成器。参数如下:
以下部分删除,请参见下面地址的原文。
本文地址
http://automationtesting.sinaapp.com/blog/m_google参考资料
?https://pypi.python.org/pypi/google?
评论关闭