Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import re, urllib
- textfile = file('depth_1.txt','wt')
- print "Enter the URL you wish to crawl.."
- myurl = raw_input("URL:> ")
- 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()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement