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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
bool paging = True
 
list categories = ['images']
 
str base_url = "https://www.svgrepo.com"
 
str results_xpath = "//div[@class='style_nodeListing__7Nmro']/div"
 
str url_xpath = ".//a/@href"
 
str title_xpath = ".//a/@title"
 
str img_src_xpath = ".//img/@src"
 

Detailed Description

Svgrepo (images)

Function Documentation

◆ request()

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

Definition at line 26 of file svgrepo.py.

26def request(query, params):
27 params['url'] = f"{base_url}/vectors/{query}/{params['pageno']}/"
28 return params
29
30

◆ response()

searx.engines.svgrepo.response ( resp)

Definition at line 31 of file svgrepo.py.

31def response(resp):
32 results = []
33
34 dom = html.fromstring(resp.text)
35 for result in eval_xpath_list(dom, results_xpath):
36 results.append(
37 {
38 'template': 'images.html',
39 'url': base_url + extract_text(eval_xpath(result, url_xpath)),
40 'title': extract_text(eval_xpath(result, title_xpath)).replace(" SVG File", "").replace("Show ", ""),
41 'img_src': extract_text(eval_xpath(result, img_src_xpath)),
42 }
43 )
44
45 return results

Variable Documentation

◆ about

dict searx.engines.svgrepo.about
Initial value:
1= {
2 "website": 'https://www.svgrepo.com',
3 "official_api_documentation": 'https://svgapi.com',
4 "use_official_api": False,
5 "require_api_key": False,
6 "results": 'HTML',
7}

Definition at line 8 of file svgrepo.py.

◆ base_url

str searx.engines.svgrepo.base_url = "https://www.svgrepo.com"

Definition at line 18 of file svgrepo.py.

◆ categories

list searx.engines.svgrepo.categories = ['images']

Definition at line 17 of file svgrepo.py.

◆ img_src_xpath

str searx.engines.svgrepo.img_src_xpath = ".//img/@src"

Definition at line 23 of file svgrepo.py.

◆ paging

bool searx.engines.svgrepo.paging = True

Definition at line 16 of file svgrepo.py.

◆ results_xpath

str searx.engines.svgrepo.results_xpath = "//div[@class='style_nodeListing__7Nmro']/div"

Definition at line 20 of file svgrepo.py.

◆ title_xpath

str searx.engines.svgrepo.title_xpath = ".//a/@title"

Definition at line 22 of file svgrepo.py.

◆ url_xpath

str searx.engines.svgrepo.url_xpath = ".//a/@href"

Definition at line 21 of file svgrepo.py.