This is for google custom search api.
Project description
How to use this package.
first please install this package
pip install google-custom-search
sample code
import google_custom_search
google=google_custom_search.custom_search(token="your api_key", engine_id="your engine_id")
result=google.search("Hello")
# get a list of title.
for title in result.titles:
print(title)
# get a list of link.
for url in result.urls:
print(url)
# get a list of displayLink.
for i in result.display_urls:
print(i)
# get a list of htmlTitle.
for i in result.html_titles:
print(i)
# get a list of snippet.
for i in result.snippets:py
print(i)
sample code async version
import asyncio
import google_custom_search
google=google_custom_search.custom_search(token="your api_key", engine_id="your engine_id")
async def main():
result=await google.search_async("word!")
for i in result.titles:
print(i)
for i in result.urls:
print(i)
for i in result.display_urls:
print(i)
for i in result.html_titles:
print(i)
for i in result.snippets:
print(i)
loop = asyncio.get_event_loop()
loop.run_until_complete(main())
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for google-custom-search-0.0.4a3.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 68eb648a0477f0851e499cb33fbb12a5dfcc67fb6ab639aae3c08846e9054b7c |
|
MD5 | 9b3885d8753bcb58e9fbe38f6034f58e |
|
BLAKE2b-256 | 2362d3458ac8b5753f2dc542b3ccd580de49bcb02ddd1ef6a9119e6f5180d09a |
Close
Hashes for google_custom_search-0.0.4a3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f1f6ce2e5a9269adb2dfe86c9b6440f7dc1c0b74f4541b9a17299869c9c592b5 |
|
MD5 | 22ef5cd8e1dab1c0c4c34aeba2f3ad83 |
|
BLAKE2b-256 | 96e18397e6cd01303136f2845d384290bf0735c61b6d756bbbadb50156630c45 |