47def response(resp):
48 results = []
49
50
51 dom = html.fromstring(resp.text)
52
53
54 for result in eval_xpath_list(dom, results_xpath):
55 url_relative = eval_xpath_getindex(result, url_xpath, 0)
56 url = base_url + url_relative
57 title = unescape(extract_text(eval_xpath(result, title_xpath)))
58 thumbnail = extract_text(eval_xpath(result, thumbnail_xpath))
59 content = extract_text(eval_xpath(result, publishedDate_xpath)) + extract_text(
60 eval_xpath(result, content_xpath)
61 )
62
63
64 results.append(
65 {
66 'url': url,
67 'title': title,
68 'content': content,
69 'template': 'videos.html',
70 'thumbnail': thumbnail,
71 }
72 )
73
74
75 return results