Skip to main content

Web search

Project description

SEARCH-ME

Version License Python Status Format Wheel Build Coverage Downloads


SEARCH-ME

INSTALL

pip install search-me

USAGE

import asyncio
import itertools
import aiohttp
import niquests
from search_me import Bing, Brave, GoodSearch

bing, brave, goodsearch = Bing(retry=3), Brave(), GoodSearch()

# ASYNC

async def main():

    headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0"}

    async with aiohttp.ClientSession(headers=headers) as session:
        results = await asyncio.gather(
            bing.search(session, q="python 3.15"),
            brave.search(session, q="python 3.15"),
            goodsearch.search(session, q="python 3.15")
            )
        for result in itertools.chain(*results):
            print(result.to_dict())


try:
    loop = asyncio.get_event_loop()
except RuntimeError as e:
    loop = asyncio.new_event_loop()
    asyncio.set_event_loop(loop)

loop.run_until_complete(main())


# SYNC

def main():

    headers = {"User-Agent": "Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:100.0) Gecko/20100101 Firefox/100.0"}

    with niquests.Session(headers=headers) as session:
        results = (engine.search(session, q="python 3.15") for engine in (bing, brave, goodsearch))
        for result in itertools.chain(*results):
            print(result.to_dict())


main()

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

search_me-4.0.0.tar.gz (552.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

search_me-4.0.0-py3-none-any.whl (552.8 kB view details)

Uploaded Python 3

File details

Details for the file search_me-4.0.0.tar.gz.

File metadata

  • Download URL: search_me-4.0.0.tar.gz
  • Upload date:
  • Size: 552.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for search_me-4.0.0.tar.gz
Algorithm Hash digest
SHA256 d7205f1ef4c277b589ef5e33d76b98f8db647018fdefba52c570009a21576c2b
MD5 10e44c7fa1413e0fd94624cc976d674e
BLAKE2b-256 488136323a2ab3a6dfcb9074a14719b7021283e4fafd0386a478f4600e74c856

See more details on using hashes here.

File details

Details for the file search_me-4.0.0-py3-none-any.whl.

File metadata

  • Download URL: search_me-4.0.0-py3-none-any.whl
  • Upload date:
  • Size: 552.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for search_me-4.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 cd8d5f2dc18e07a25dc9083a667f62c76a163d5d46384567d28f450a3437ea7e
MD5 6ed8f9340fc268d0634f137c0eaa25c9
BLAKE2b-256 1304e454462fa02d5c72d659ac29fb1bb06a5d67037298a28e23fd1072a0257c

See more details on using hashes here.

Supported by

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