Skip to content

Instantly share code, notes, and snippets.

@djs
Created June 3, 2012 22:58
Show Gist options
  • Save djs/2865323 to your computer and use it in GitHub Desktop.
Save djs/2865323 to your computer and use it in GitHub Desktop.
print urls with 404
import fileinput
import sys
import urllib2
def check_404(url):
try:
urllib2.urlopen(url);
except urllib2.HTTPError as e:
if e.code == 404:
print url
if __name__ == '__main__':
for line in fileinput.input():
check_404(line.strip())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment