mirror of https://github.com/searx/searx
[fix] FutureWarning from lxml
Just in case if content is None, the original code will skip extract_text(), and just append the None value to 'content'. So just add allow_none=True, and this will return None without raising a ValueError in extract_text().
This commit is contained in:
parent
27db4e33e4
commit
b959c990df
|
@ -135,8 +135,7 @@ def response(resp):
|
||||||
content = eval_xpath_getindex(
|
content = eval_xpath_getindex(
|
||||||
result, './/div[contains(@class, "compText")]', 0, default=''
|
result, './/div[contains(@class, "compText")]', 0, default=''
|
||||||
)
|
)
|
||||||
if content:
|
content = extract_text(content, allow_none=True)
|
||||||
content = extract_text(content)
|
|
||||||
|
|
||||||
# append result
|
# append result
|
||||||
results.append({'url': url,
|
results.append({'url': url,
|
||||||
|
|
Loading…
Reference in New Issue