Papajams commited on
Commit
edba26a
1 Parent(s): 893d1ba

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -36,7 +36,7 @@ def search_arxiv(query, max_results=3):
36
  try:
37
  response = requests.get(base_url + query)
38
  if response.status_code == 200:
39
- data = response.text
40
 
41
  # Parse the XML response
42
  root = ET.fromstring(data)
@@ -48,6 +48,7 @@ def search_arxiv(query, max_results=3):
48
  # Extract information from each entry
49
  result["title"] = entry.find("{http://www.w3.org/2005/Atom}title").text
50
  result["abstract"] = entry.find("{http://arxiv.org/schemas/atom}summary").text
 
51
 
52
  authors = []
53
  for author in entry.findall("{http://www.w3.org/2005/Atom}author"):
 
36
  try:
37
  response = requests.get(base_url + query)
38
  if response.status_code == 200:
39
+ data = response.content
40
 
41
  # Parse the XML response
42
  root = ET.fromstring(data)
 
48
  # Extract information from each entry
49
  result["title"] = entry.find("{http://www.w3.org/2005/Atom}title").text
50
  result["abstract"] = entry.find("{http://arxiv.org/schemas/atom}summary").text
51
+ result["link"] = entry.find("{http://www.w3.org/2005/Atom}link[@title='pdf']").attrib["href"]
52
 
53
  authors = []
54
  for author in entry.findall("{http://www.w3.org/2005/Atom}author"):