We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9d9f567 commit 1f066f1Copy full SHA for 1f066f1
scratchattach/site/user.py
@@ -375,6 +375,13 @@ def loves_count(self):
375
headers=self._headers
376
).text
377
378
+ # If there are no loved projects, then Scratch doesn't actually display the number - so we have to catch this
379
+ soup = BeautifulSoup(text, "html.parser")
380
+
381
+ if not soup.find("li", {"class": "project thumb item"}):
382
+ # There are no projects, so there are no projects loved
383
+ return 0
384
385
return commons.webscrape_count(text, "»\n\n (", ")")
386
387
def favorites(self, *, limit=40, offset=0):
0 commit comments