File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ def parse(url):
11
11
domain = sublevel_split [0 ].replace ("www." , "" )
12
12
return domain
13
13
except IndexError :
14
- print "URL format error!"
14
+ print "URL format error! url = {}" . format ( url )
15
15
16
16
def analyze (results ):
17
17
@@ -45,8 +45,12 @@ def analyze(results):
45
45
#print cursor.fetchall()
46
46
47
47
#url and visit counts
48
- select_statement = "SELECT urls.url, urls.visit_count FROM urls, visits WHERE urls.id = visits.url;"
49
- cursor .execute (select_statement )
48
+ try :
49
+ select_statement = "SELECT urls.url, urls.visit_count FROM urls, visits WHERE urls.id = visits.url;"
50
+ cursor .execute (select_statement )
51
+ except sqlite3 .OperationalError :
52
+ print "[!] The database is locked! Please exit Chrome and run the script again."
53
+ quit ()
50
54
51
55
results = cursor .fetchall () #tuple
52
56
You can’t perform that action at this time.
0 commit comments