MCPcopy
hub / github.com/searx/searx / response

Function response

searx/engines/etools.py:42–56  ·  view source on GitHub ↗
(resp)

Source from the content-addressed store, hash-verified

40
41
42def response(resp):
43 results = []
44
45 dom = html.fromstring(resp.text)
46
47 for result in eval_xpath(dom, '//table[@class="result"]//td[@class="record"]'):
48 url = eval_xpath(result, './a/@href')[0]
49 title = extract_text(eval_xpath(result, './a//text()'))
50 content = extract_text(eval_xpath(result, './/div[@class="text"]//text()'))
51
52 results.append({'url': url,
53 'title': title,
54 'content': content})
55
56 return results

Callers

nothing calls this directly

Calls 2

eval_xpathFunction · 0.90
extract_textFunction · 0.90

Tested by

no test coverage detected