任何人都可以帮助我如何编写一个Python脚本来搜索谷歌并打印热门结果的链接。
试试这个,使用起来非常简单:https://pypi.python.org/pypi/google https://pypi.python.org/pypi/google
Docs: https://breakcode.wordpress.com/2010/06/29/google-search-python/ https://breakingcode.wordpress.com/2010/06/29/google-search-python/
Github: https://github.com/MarioVilas/google https://github.com/MarioVilas/google
安装这个 python 包,使用方法就这么简单:
# 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)