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.4a1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | f37e1f8fdeb0281045733d3d1ad4c69c2fa142a5c026820541c255dc62c32d6f |
|
MD5 | 13a01aadb81e73ceadd2167c130ffeee |
|
BLAKE2b-256 | 78c66637f16fa3daa18653e75352792a962aafd6dfc91e5ad8c7e321c4ed9fd2 |
Close
Hashes for google_custom_search-0.0.4a1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 23f9c7c690ee3f28d222f80c9cd247a3b02e5190a64ac7ff8b9c949e6b38de67 |
|
MD5 | d5c83bf1d5cc711cf38e73963387a19c |
|
BLAKE2b-256 | 43f07a9bda35eeaf09488be73ca0b8a865e1e6dfc7fcaef1b1604f01c924a873 |