41xpath_author_name = XPath(
'.//atom:author/atom:name', namespaces=arxiv_namespaces)
63 dom = etree.fromstring(resp.content)
64 for entry
in eval_xpath_list(dom, xpath_entry):
65 title = eval_xpath_getindex(entry, xpath_title, 0).text
67 url = eval_xpath_getindex(entry, xpath_id, 0).text
68 abstract = eval_xpath_getindex(entry, xpath_summary, 0).text
70 authors = [author.text
for author
in eval_xpath_list(entry, xpath_author_name)]
73 doi_element = eval_xpath_getindex(entry, xpath_doi, 0, default=
None)
74 doi =
None if doi_element
is None else doi_element.text
77 pdf_element = eval_xpath_getindex(entry, xpath_pdf, 0, default=
None)
78 pdf_url =
None if pdf_element
is None else pdf_element.attrib.get(
'href')
81 journal_element = eval_xpath_getindex(entry, xpath_journal, 0, default=
None)
82 journal =
None if journal_element
is None else journal_element.text
85 tag_elements = eval_xpath(entry, xpath_category)
86 tags = [str(tag)
for tag
in tag_elements]
89 comments_elements = eval_xpath_getindex(entry, xpath_comment, 0, default=
None)
90 comments =
None if comments_elements
is None else comments_elements.text
92 publishedDate = datetime.strptime(eval_xpath_getindex(entry, xpath_published, 0).text,
'%Y-%m-%dT%H:%M:%SZ')
95 'template':
'paper.html',
98 'publishedDate': publishedDate,
104 'comments': comments,
108 results.append(res_dict)