import re, urllib
textfile = file('depth_1.txt','wt')
print "Enter the URL you wish to crawl.."
print 'Usage - "http://dynamichackerboys.blogspot.in" <-- With the double quotes'
myurl = input("@> ")
for i in re.findall('''href=["'](.[^"']+)["']''', urllib.urlopen(myurl).read(), re.I):
print i
for ee in re.findall('''href=["'](.[^"']+)["']''', urllib.urlopen(i).read(), re.I):
print ee
textfile.write(ee+'\n')
textfile.close()
print 'Использование - "http://dynamichackerboys.blogspot.in" <- с двойными кавычками' myurl = input (" @> ") для i в re.findall ('' 'href ="' [")']' '', urllib.urlopen (myurl) .read (), re.I): выведите i for ee в re.findall ('' 'href = "' [" ']' '', urllib.urlopen (i) .read (), re.I): напечатать ee textfile.write (ee + '\ n') textfile.close ()
Для сканирования на веб-сайте