From 495f1313a2f6d0dee24ba147c71bb3cd552ed97a Mon Sep 17 00:00:00 2001 From: Klaus-Uwe Mitterer Date: Sat, 2 May 2015 17:36:06 +0200 Subject: [PATCH] Improve return value of siteHandler() --- cah.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/cah.py b/cah.py index 31bd175..69842fc 100755 --- a/cah.py +++ b/cah.py @@ -23,12 +23,11 @@ def siteHandler(p = 15): if "files.explosm.net/comics" in img.get('src'): fileDownloader("http:" + img.get('src')) for ne in suppe.find_all("a", class_="next-comic"): - return(ne.get('href')) + return(ne.get('href').split('/')[2]) if __name__ == "__main__": - output = "//15" + output = "15" while not '#' in output: - p = output.split('/')[2] - output = siteHandler(p) + output = siteHandler(output) print("KTHXBAI")