File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed
Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change 7272 # If we are retrieving this page, there should be no links from it
7373 cur .execute ('DELETE from Links WHERE from_id=?' , (fromid , ) )
7474 try :
75- # Deal with SSL certificate anomalies Python > 2.7
76- # scontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
75+ # Deal with SSL certificate anomalies Python > 2.7
76+ # scontext = ssl.SSLContext(ssl.PROTOCOL_TLSv1)
7777 # document = urllib.urlopen(url, context=scontext)
78-
79- # Normal Unless you encounter certificate problems
78+
79+ # Normal Unless you encounter certificate problems
8080 document = urllib .urlopen (url )
8181
8282 html = document .read ()
8686
8787 if 'text/html' != document .info ().gettype () :
8888 print "Ignore non text/html page"
89- cur .execute ('DELETE FROM Pages WHERE url=?' , ( url , ) )
90- cur .execute ('UPDATE Pages SET error=0 WHERE url=?' , (url , ) )
89+ cur .execute ('UPDATE Pages SET error=-1 WHERE url=?' , (url , ) )
9190 conn .commit ()
9291 continue
9392
125124 # print href
126125 if ( len (href ) < 1 ) : continue
127126
128- # Check if the URL is in any of the webs
127+ # Check if the URL is in any of the webs
129128 found = False
130129 for web in webs :
131130 if ( href .startswith (web ) ) :
You can’t perform that action at this time.
0 commit comments