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("眠い")
for i in result.titles:
print(i)
for i in result.urls:
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.4a0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b50aa67d5cc04fc981c354526fb2f8fb5c5a27392a401adf4a1f5ec5188a3840 |
|
MD5 | 52106f5376961be8a8c33d3f01e312fa |
|
BLAKE2b-256 | fef2296c7b9e7455751cbcde804aa7524abae0f698cea1bcd696bc36cde14a5c |
Close
Hashes for google_custom_search-0.0.4a0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 52ffa8c2d62194d03a4e5fdbd39e2fb50b0a9482fad34e324556c4c3d3744fbe |
|
MD5 | 8e0bdb98090f804644d480b25c74374d |
|
BLAKE2b-256 | 0e8576077fdc48a46f74683eb92db354dccee4b492ad4db6f91908fbf4f58eab |