@@ -2,7 +2,7 @@
22
33"""
44 ArXiV (Scientific preprints)
5− @website https://axiv.org
5+ @website https://arxiv.org
66 @provide-api yes (export.arxiv.org/api/query)
77 @using-api yes
88 @results XML-RSS
@@ -41,7 +41,8 @@ def request(query, params):
4141def response(resp):
4242 results = []
4343
44− search_results = html.fromstring(resp.text).xpath('//entry')
44+ dom = html.fromstring(resp.content)
45+ search_results = dom.xpath('//entry')
4546
4647 for entry in search_results:
4748 title = entry.xpath('.//title')[0].text
@@ -49,15 +50,15 @@ def response(resp):
4950 url = entry.xpath('.//id')[0].text
5051
5152 content_string = '{doi_content}{abstract_content}'
52−
53+
5354 abstract = entry.xpath('.//summary')[0].text
5455
5556 # If a doi is available, add it to the snipppet
5657 try:
5758 doi_content = entry.xpath('.//link[@title="doi"]')[0].text
58− content = content_string.format(doi_content=doi_content, abstract_content=abstract_content)
59+ content = content_string.format(doi_content=doi_content, abstract_content=abstract)
5960 except:
60− content = content_string.format(abstract_content=abstract_content)
61+ content = content_string.format(doi_content="", abstract_content=abstract)
6162
6263 if len(content) > 300:
6364 content = content[0:300] + "..."