merged 2 if statements in crawler

This commit is contained in:
Askill 2022-12-11 13:18:56 +01:00
parent 32e10d2665
commit 2339d78ad7
1 changed files with 3 additions and 5 deletions

View File

@ -71,12 +71,10 @@ 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