Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

import argparse
import os
import time

import json
import logging
Expand Down Expand Up @@ -101,6 +102,9 @@ def exclude_url(exclude, link):
else:
logging.debug ("Continue without output file.")

if arg.debug or arg.report:
time_start = time.clock()

tocrawl = set([arg.domain])
crawled = set([])
excluded = set([])
Expand Down Expand Up @@ -239,9 +243,13 @@ def exclude_url(exclude, link):
tocrawl.add(link)
print (footer, file=output_file)

if arg.debug or arg.report:
time_total = time.clock() - time_start

if arg.debug:
logging.debug ("Number of found URL : {0}".format(nb_url))
logging.debug ("Number of link crawled : {0}".format(len(crawled)))
logging.debug ("Duration : {0}s".format(time_total))

if arg.report:
print ("Number of found URL : {0}".format(nb_url))
Expand All @@ -254,5 +262,7 @@ def exclude_url(exclude, link):
for code in response_code:
print ("Nb Code HTTP {0} : {1}".format(code, response_code[code]))

print ("Duration : {0}s".format(int(time_total)))

if output_file:
output_file.close()