37def response(resp) -> EngineResults:
38 res = EngineResults()
39
40 dom = html.fromstring(resp.text)
41
42 for item in eval_xpath_list(dom, results_xpath):
43 published_date = None
44 try:
45 published_date = datetime.strptime(
46 extract_text(eval_xpath(item, publish_date_xpath)), "%b %d, %Y %I:%M %p %Z"
47 )
48 except ValueError:
49 pass
50
51 res.add(
52 res.types.MainResult(
53 title=extract_text(eval_xpath(item, title_xpath)),
54 content=extract_text(eval_xpath(item, content_xpath)),
55 url=f"{base_url}{eval_xpath_getindex(item, url_xpath, 0)}",
56 publishedDate=published_date,
57 )
58 )
59
60 return res