mirror of https://github.com/Askill/optar.git
merged 2 if statements in crawler
This commit is contained in:
parent
32e10d2665
commit
2339d78ad7
|
|
@ -71,13 +71,11 @@ class Crawler:
|
||||||
|
|
||||||
n_links = []
|
n_links = []
|
||||||
for link in _links:
|
for link in _links:
|
||||||
if link not in n_links:
|
if link not in n_links and level < limit:
|
||||||
if link.startswith("http"):
|
if link.startswith("http"):
|
||||||
if level < limit:
|
n_links.append((level+1, link))
|
||||||
n_links.append((level+1, link))
|
|
||||||
else:
|
else:
|
||||||
if level < limit:
|
n_links.append((level+1, urljoin(site.url, link)))
|
||||||
n_links.append((level+1, urljoin(site.url, link)))
|
|
||||||
|
|
||||||
unchecked += n_links
|
unchecked += n_links
|
||||||
self._links[root] = n_links
|
self._links[root] = n_links
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue