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.4a5.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1255ea9f510d8dc5ef7040436d42d4db81d90b364662f1abce47905f4c398352 |
|
MD5 | ac8a6200af6c97a733d137806ace9a5c |
|
BLAKE2b-256 | 0e75104f13a3eda2893d360ce3038f58679f67786ae680649b978f4caf853ed4 |
Close
Hashes for google_custom_search-0.0.4a5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fc6162544be916ac7912d8a41612674683afada9a9ccb2c7b9494ec50b079c5c |
|
MD5 | b8c05b7b55888a29697f6e057aaaec4d |
|
BLAKE2b-256 | f95bddc098d9474d11b7a6327d231ec9ef336df0aa6f7a73ec03a8dfd671a292 |