aboutsummaryrefslogtreecommitdiff
path: root/libraries/aspen.py
diff options
context:
space:
mode:
Diffstat (limited to 'libraries/aspen.py')
-rw-r--r--libraries/aspen.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/libraries/aspen.py b/libraries/aspen.py
index 40e67c1..b024263 100644
--- a/libraries/aspen.py
+++ b/libraries/aspen.py
@@ -54,7 +54,11 @@ class Library(BaseLibrary):
"Referer": f"{b}/MyAccount/CheckedOut?source=all"
}
s.get(f"{b}/Holds?source=ils",headers=headers)
- output = s.get(f"{b}/AJAX?method=getHolds&source=all",headers=headers)
+ params = {
+ "method": "getHolds",
+ "source": "all"
+ }
+ output = s.get(f"{b}/MyAccount/AJAX",params=params,headers=headers)
output = json.loads(output.content)["holds"].replace("\xa0"," ")
soup = BeautifulSoup(output, "html.parser")
try:
@@ -65,8 +69,8 @@ class Library(BaseLibrary):
if unavailableholds_all:
items = unavailableholds_all.find_all("div",class_=["result"])
for i in items:
- labels = [j.text for i in i.find_all("div","result-label")]
- values = [j.text for i in i.find_all("div","result-value")]
+ labels = [j.text for j in i.find_all("div","result-label")]
+ values = [j.text for j in i.find_all("div","result-value")]
values_dict = dict(map(lambda i,j:(i,j),labels,values))
title_obj = i.find("a",class_="result-title")
img_href = i.find("img")["src"]
@@ -84,13 +88,12 @@ class Library(BaseLibrary):
"img_type": img_type,
}
unavailableReservations.append(obj)
-
# WORKHERE: availableHolds, might not be available.
# Return a single list of objects
return availableReservations + unavailableReservations
def get_checkouts(self, verbose = False):
- # WORKHERE: no example of possible/completed renewals at this time
+ # WORKHERE: no example of completed renewals at this time
checked_out_objects = []
b = self.baseurl
s = self.session
bgstack15