46 dom = html.fromstring(resp.text)
49 extra_xpath = results_xpath_filter_recommended
if resp.search_params[
'pageno'] > 1
else ''
50 res_xpath = results_xpath.format(extra=extra_xpath)
52 for result
in eval_xpath_list(dom, res_xpath):
53 doctype = extract_text(eval_xpath(result, doctype_xpath))
54 date = extract_text(eval_xpath(result, date_xpath))
56 metadata = [meta
for meta
in (doctype, date)
if meta !=
""]
60 'url': base_url +
"/" + extract_text(eval_xpath(result, url_xpath)),
61 'title': extract_text(eval_xpath(result, title_xpath)),
62 'content': extract_text(eval_xpath(result, content_xpath)),
63 'metadata':
', '.join(metadata),