Python 3.7+ is required
# MacOS / Linux (via Terminal)
python3 -m pip install -U searchor
# Windows (via CMD Prompt)
py -3 -m pip install -U searchor
>>> from searchor import Engine
>>> Engine.Google.search("Hello, World!"))
'https://www.google.com/search?q=Hello%2C%20World%21'
>>> from searchor import Engine
>>> Engine.new("Colgate", "https://www.colgate.com/en-us/search/all?term=")
>>> Engine.Colgate.search("Hi world!", copy_url=True)
'https://www.colgate.com/en-us/search/all?term=Hi%20world!"
Searchor CLI Quick Start
$ searchor Google "Hello World!" --copy
Take a look at more examples in the examples folder!
Note: Engine names follow the UpperCamelCase convention.(eg: ChromeWebStore).
Building the docker image
$ docker build -t searchor .
Running searchor on the docker container
$ docker run --rm -it searchor bash
root@36126d096405:/usr/src/searchor/examples# python searchamazon.py
https://www.amazon.com/s?k=Hello%2C%20World%21
root@36126d096405:/usr/src/searchor/examples# exit
exit
- [VULNERABILITY] Patched a priority vulnerability in the Searchor CLI (check out the patch here)
- [ADDED] Added Pinterest search engine
- [ADDED] Added Docker to build and test Searchor
Instead of different functions for each engine, Searchor v2.2.0
uses a single function with an Engine
enum. This makes it easier to use and maintain. If you're migrating from v2.0.0
, compare the differences between the following snippets:
# Searchor 2.0.0
from searchor import search, Engine
search("Hello, World!", Engine.Google)
# Searchor v2.2.0
from searchor import Engine
Engine.Google.search("Hello, World!")
Take a look at the contributing guidelines!