elm.web.search.dux.DuxDistributedGlobalSearch
- class DuxDistributedGlobalSearch(region='us-en', safesearch='moderate', timelimit=None, page=1, backend=('google', 'bing', 'yahoo', 'duckduckgo'), timeout=10, verify=False)[source]
Bases:
SearchEngineLinkSearch
Search the web for links using DuxDistributedGlobalSearch
- Parameters:
region (str, optional) – DuxDistributedGlobalSearch search region param. By default,
"us-en"
.safesearch ({on, moderate, off}, optional) – The safesearch setting for search engines. By default,
None
.timelimit ({d, w, m, y}, optional) –
The time limit used to bound the search results:
-d: last day -w: last week -m: last month -y: last year
By default,
None
.page (int, default=1) – The page of results to return. By default,
1
.backend (str or iter of str, optional) –
Option for DuxDistributedGlobalSearch backend:
auto: Randomly select 3 search engines to use
all: All available search engines are used
wikipedia: Wikipedia
google: Google
bing: Bing
brave: Brave
mojeek: Mojeek
yahoo: Yahoo
yandex: Yandex
duckduckgo: Duckduckgo
Can also be a list or tuple of a combination of these. By default,
("google", "bing", "yahoo", "duckduckgo")
.timeout (int, optional) – Timeout for HTTP requests, in seconds. By default,
10
.verify (bool, optional) – Apply SSL verification when making the request. By default,
False
.
Methods
results
(*queries[, num_results])Retrieve links for the first num_results of each query
- async results(*queries, num_results=10)
Retrieve links for the first num_results of each query
This function executes a search for each input query and returns a list of links corresponding to the top num_results.
- Parameters:
*queries (str) – One or more queries to search for.
num_results (int, optional) – Maximum number of top results to retrieve for each query. Note that this value can never exceed the number of results per page (typically 10). If you pass in a larger value, it will be reduced to the number of results per page. There is also no guarantee that the search query will return this many results - the actual number of results returned is determined by the number of results on a page (excluding ads). You can, however, use this input to limit the number of results returned. By default,
10
.
- Returns:
list – List equal to the length of the input queries, where each entry is another list containing no more than num_results links.