|
|
@@ -16,12 +16,16 @@ class FrontPage():
|
|
|
if url.startswith("http"):
|
|
|
return url.strip()
|
|
|
|
|
|
- if url.startswith("/"):
|
|
|
+ if url.startswith("/"): #'abs'
|
|
|
domain=self.getDomain(baseurl)
|
|
|
if domain.endswith("/") and url.startswith("/"):
|
|
|
url=url[1:]
|
|
|
-
|
|
|
url=domain+url
|
|
|
+ else: #relative
|
|
|
+ arr=baseurl.split("/")
|
|
|
+ arr.pop()
|
|
|
+ arr.append(url)
|
|
|
+ url="/".join(arr)
|
|
|
|
|
|
return url.strip()
|
|
|
|
|
|
@@ -36,3 +40,5 @@ class FrontPage():
|
|
|
print(url)
|
|
|
continue
|
|
|
self.links.append({ "href": self.fixHref(l["href"],url),"title":l.get_text() })
|
|
|
+
|
|
|
+
|