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.4a4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4b8d56b0fb43434c25a1b3922a38afb71410165920db497ce5dacec8c4db1388 |
|
MD5 | e9070a2862a4baf589ce38ad835fc3a1 |
|
BLAKE2b-256 | a1636820c39827758aa8c43f50dba6a5aeae5e989abc2d5e0b60b59384b5cdc8 |
Close
Hashes for google_custom_search-0.0.4a4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 084f532b6bdc16a3ee9e5495f26a09471ea914bb70337e92583da319b10ca32f |
|
MD5 | a00d1db31e658daecd947ddb88f236c1 |
|
BLAKE2b-256 | 36a5fbf1ccc93f905ce21174b8d27c764bef7d546ce9ac040f46537c37522418 |