forked from Ponysearch/Ponysearch
[fix] engine - brave
This commit is contained in:
parent
f182abd6f8
commit
b189578b6b
1 changed files with 6 additions and 6 deletions
|
@ -245,13 +245,13 @@ def _parse_search(resp):
|
||||||
|
|
||||||
for result in eval_xpath_list(dom, xpath_results):
|
for result in eval_xpath_list(dom, xpath_results):
|
||||||
|
|
||||||
url = eval_xpath_getindex(result, './/a[@class="result-header"]/@href', 0, default=None)
|
url = eval_xpath_getindex(result, './/a[contains(@class, "h")]/@href', 0, default=None)
|
||||||
title_tag = eval_xpath_getindex(result, './/span[@class="snippet-title"]', 0, default=None)
|
title_tag = eval_xpath_getindex(result, './/div[contains(@class, "title")]', 0, default=None)
|
||||||
if not (url and title_tag):
|
if url is None or title_tag is None:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
content_tag = eval_xpath_getindex(result, './/p[@class="snippet-description"]', 0, default='')
|
content_tag = eval_xpath_getindex(result, './/div[@class="snippet-description"]', 0, default='')
|
||||||
img_src = eval_xpath_getindex(result, './/img[@class="thumb"]/@src', 0, default='')
|
img_src = eval_xpath_getindex(result, './/img[contains(@class, "thumb")]/@src', 0, default='')
|
||||||
|
|
||||||
item = {
|
item = {
|
||||||
'url': url,
|
'url': url,
|
||||||
|
|
Loading…
Reference in a new issue