Skip to main content

Simple web search library

Project description

hanapin

Simple web search library

Install

$ pip3 install hanapin

Usage

Google

from hanapin import Google

# you can explicitly add the count result with the `count` argument, 
#   `search = Google(query="hello", count=1)`
# search results may not yield the exact specified count
search = Google(query="hello")

Bing

from hanapin import Bing

# you can explicitly add the count result with the `count` argument, 
#   `search = Bing(query="hello", count=1)`
# search results may not yield the exact specified count
search = Bing(query="hello")

DuckDuckGo

from hanapin import DuckDuckGo

# explicitly setting search results count is not applicable,
search = DuckDuckGo(query="hello")

Ask.com

from hanapin import Ask

# explicitly setting search results count is not applicable,
search = Ask(query="hello")

Get search results

Scraped search results are only the first ones the can be seen from the search engine's results.

  • Search results are accesible from the class object's .results() function.
for i in search.results():
    print(i["title"], "::", i["link"])

Credits

Libraries Used

  • BeautifulSoup4
  • requests
  • lxml

© TheBoringDude | MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hanapin-0.1.6.tar.gz (3.6 kB view hashes)

Uploaded Source

Built Distribution

hanapin-0.1.6-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page