.oO SearXNG Developer Documentation Oo.
Loading...
Searching...
No Matches
searx.engines.cppreference Namespace Reference

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['it']
 
str url = 'https://en.cppreference.com/'
 
str search_url = url + 'mwiki/index.php?title=Special%3ASearch&search={query}'
 

Detailed Description

Cppreference

Function Documentation

◆ request()

searx.engines.cppreference.request ( query,
params )

Definition at line 23 of file cppreference.py.

23def request(query, params):
24 params['url'] = search_url.format(query=query)
25 return query
26
27

◆ response()

searx.engines.cppreference.response ( resp)

Definition at line 28 of file cppreference.py.

28def response(resp):
29 results = []
30 dom = html.fromstring(resp.text)
31 for result in eval_xpath(dom, '//div[contains(@class, "mw-search-result-heading")]'):
32 results.append(
33 {
34 'url': url + eval_xpath(result, './/a/@href')[0],
35 'title': eval_xpath(result, './/a/text()')[0],
36 }
37 )
38 return results

Variable Documentation

◆ about

dict searx.engines.cppreference.about
Initial value:
1= {
2 "website": "https://en.cppreference.com/",
3 "wikidata_id": None,
4 "official_api_documentation": None,
5 "use_official_api": False,
6 "require_api_key": False,
7 "results": 'HTML',
8}

Definition at line 8 of file cppreference.py.

◆ categories

list searx.engines.cppreference.categories = ['it']

Definition at line 18 of file cppreference.py.

◆ search_url

str searx.engines.cppreference.search_url = url + 'mwiki/index.php?title=Special%3ASearch&search={query}'

Definition at line 20 of file cppreference.py.

◆ url

str searx.engines.cppreference.url = 'https://en.cppreference.com/'

Definition at line 19 of file cppreference.py.