mirror of
https://github.com/searxng/searxng.git
synced 2024-12-12 12:26:27 +00:00
[mod][fix] startpage engine updates
This commit is contained in:
parent
6f86b96a35
commit
7db4558de7
1 changed files with 4 additions and 1 deletions
|
@ -29,9 +29,12 @@ def response(resp):
|
||||||
dom = html.fromstring(resp.content)
|
dom = html.fromstring(resp.content)
|
||||||
# ads xpath //div[@id="results"]/div[@id="sponsored"]//div[@class="result"]
|
# ads xpath //div[@id="results"]/div[@id="sponsored"]//div[@class="result"]
|
||||||
# not ads: div[@class="result"] are the direct childs of div[@id="results"]
|
# not ads: div[@class="result"] are the direct childs of div[@id="results"]
|
||||||
for result in dom.xpath('//div[@id="results"]/div[@class="result"]'):
|
for result in dom.xpath('//div[@class="result"]'):
|
||||||
link = result.xpath('.//h3/a')[0]
|
link = result.xpath('.//h3/a')[0]
|
||||||
url = link.attrib.get('href')
|
url = link.attrib.get('href')
|
||||||
|
if url.startswith('http://www.google.')\
|
||||||
|
or url.startswith('https://www.google.'):
|
||||||
|
continue
|
||||||
title = link.text_content()
|
title = link.text_content()
|
||||||
|
|
||||||
content = ''
|
content = ''
|
||||||
|
|
Loading…
Reference in a new issue