70 dom = html.fromstring(resp.text)
71 for result
in eval_xpath_list(dom,
"//article[contains(@class, 'listview__item')]"):
73 for spec
in eval_xpath_list(result,
".//div[contains(@class, 'specs-grid__item')]"):
74 content.append(f
"{extract_text(eval_xpath(spec, './dt'))}: {extract_text(eval_xpath(spec, './dd'))}")
77 extract_text(eval_xpath(result,
".//div[contains(@class, 'stars-rating-label')]")),
78 extract_text(eval_xpath(result,
".//div[contains(@class, 'listview__offercount')]")),
82 'template':
'products.html',
84 base_url +
"/" + extract_text(eval_xpath(result,
".//a[contains(@class, 'listview__name-link')]/@href"))
86 'title': extract_text(eval_xpath(result,
".//h3[contains(@class, 'listview__name')]")),
87 'content':
' | '.join(content),
88 'thumbnail': extract_text(eval_xpath(result,
".//img[contains(@class, 'listview__image')]/@src")),
89 'metadata':
', '.join(item
for item
in metadata
if item),
92 best_price = extract_text(eval_xpath(result,
".//a[contains(@class, 'listview__price-link')]")).split(
" ")
93 if len(best_price) > 1:
94 item[
"price"] = f
"Bestes Angebot: {best_price[1]}€"