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

Functions

 request (query, params)
 
 response (resp)
 

Variables

dict about
 
list categories = ['general', 'web']
 
str base_url = 'https://search.seznam.cz/'
 

Detailed Description

Seznam

Function Documentation

◆ request()

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

Definition at line 31 of file seznam.py.

31def request(query, params):
32 response_index = get(base_url, headers=params['headers'], raise_for_httperror=True)
33 dom = html.fromstring(response_index.text)
34
35 url_params = {
36 'q': query,
37 'oq': query,
38 }
39 for e in eval_xpath_list(dom, '//input[@type="hidden"]'):
40 name = e.get('name')
41 value = e.get('value')
42 url_params[name] = value
43
44 params['url'] = base_url + '?' + urlencode(url_params)
45 params['cookies'] = response_index.cookies
46 return params
47
48

◆ response()

searx.engines.seznam.response ( resp)

Definition at line 49 of file seznam.py.

49def response(resp):
50 if resp.url.path.startswith('/verify'):
51 raise SearxEngineAccessDeniedException()
52
53 results = []
54
55 dom = html.fromstring(resp.content.decode())
56 for result_element in eval_xpath_list(
57 dom, '//div[@id="searchpage-root"]//div[@class="Layout--left"]/div[@class="f2c528"]'
58 ):
59 result_data = eval_xpath_getindex(
60 result_element, './/div[@class="c8774a" or @class="e69e8d a11657"]', 0, default=None
61 )
62 if result_data is None:
63 continue
64 title_element = eval_xpath_getindex(result_element, './/h3/a', 0)
65 results.append(
66 {
67 'url': title_element.get('href'),
68 'title': extract_text(title_element),
69 'content': extract_text(result_data),
70 }
71 )
72
73 return results

Variable Documentation

◆ about

dict searx.engines.seznam.about
Initial value:
1= {
2 "website": "https://www.seznam.cz/",
3 "wikidata_id": "Q3490485",
4 "official_api_documentation": "https://api.sklik.cz/",
5 "use_official_api": False,
6 "require_api_key": False,
7 "results": "HTML",
8 "language": "cz",
9}

Definition at line 17 of file seznam.py.

◆ base_url

str searx.engines.seznam.base_url = 'https://search.seznam.cz/'

Definition at line 28 of file seznam.py.

◆ categories

list searx.engines.seznam.categories = ['general', 'web']

Definition at line 27 of file seznam.py.