46 dom = html.fromstring(resp.text)
47 for entry
in eval_xpath_list(dom,
'/html/body/main/div/div/div/form/div/ul/li/a[@class="package-snippet"]'):
48 url = base_url + extract_text(eval_xpath_getindex(entry,
'./@href', 0))
49 title = extract_text(eval_xpath_getindex(entry,
'./h3/span[@class="package-snippet__name"]', 0))
50 version = extract_text(eval_xpath_getindex(entry,
'./h3/span[@class="package-snippet__version"]', 0))
51 created_at = extract_text(
52 eval_xpath_getindex(entry,
'./h3/span[@class="package-snippet__created"]/time/@datetime', 0)
54 content = extract_text(eval_xpath_getindex(entry,
'./p', 0))
57 "template":
"packages.html",
60 'package_name': title,
63 'publishedDate': parser.parse(created_at),