Advertisement
Guest User

Untitled

a guest
May 27th, 2016
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. import re, urllib
  2.  
  3. textfile = file('depth_1.txt','wt')
  4. print "Enter the URL you wish to crawl.."
  5.  
  6. myurl = raw_input("URL:> ")
  7. for i in re.findall('''href=["'](.[^"']+)["']''', urllib.urlopen(myurl).read(), re.I):
  8. print i
  9. for ee in re.findall('''href=["'](.[^"']+)["']''', urllib.urlopen(i).read(), re.I):
  10. print ee
  11. textfile.write(ee+'\n')
  12. textfile.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement