Make search engine queries within your python applications. Searchenginepy allows you to query some of the most common search engines.
First install searchenginepy and then import it into your project. After importing, you can make queries on the four support search engines. Once a query has been made, a list of the top results will be returned. Initially it configured to display the top results but you are able to select which page you woud like to see in your list.
pip install searchenginepy
from searchenginepy import SearchEngine
engine=SearchEngine()
If you want to use multiple search engine in your project then you can use the SearchEngine() class to access all four available search engines
list=engine.search("search query")
list=engine.google("search query")
using google to search a query
You can also create instances of specific search engines to be used throughout your project. This will only give you access to that engine unlike the SearchEngine() class.
from searchenginepy.Google import Google
list=Google().search("search query")
from searchenginepy.Bing import Bing
list=Bing().search("search query")
from searchenginepy.Brave import Brave
list=Brave().search("search query")
from searchenginepy.DuckDuckGo import DuckDuckGo
list=DuckDuckGo().search("search query")
from searchenginepy.Google import Google
Google.httpallowed = false
results=Google().search("search query")
The page number is set to 1 by default but you can can pass in the desired page after your query as seen below
from searchenginepy.Google import Google
results=Google().search("search query", 3)
- Bing
- DuckDuckGo
- Brave