leonteale

temp

Jan 2nd, 2014
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.77 KB | None | 0 0
  1. #! /usr/bin/env python
  2. import os,sys
  3. from BeautifulSoup import BeautifulSoup
  4. #from bs4 import BeautifulSoup
  5. import urllib2, re
  6.  
  7.  
  8. html = urllib2.urlopen('http://www.shodanhq.com/search?q=%22Default+Login%22+Authenticate').read()
  9. soup = BeautifulSoup(html)
  10. texts = soup.findAll(text=True)
  11.  
  12. for each_div in soup.findAll('div',{'class':'result'}):
  13. print "RESULT:"
  14. print each_div.a.get('href')
  15. start = each_div.p.encode_contents().lower().find('default')
  16. end = each_div.p.encode_contents().find('<br/>',start)
  17. stripping = each_div.p.encode_contents()[start:end]
  18. # print each_div.p.encode_contents()[start:end]
  19. print stripping.replace('<strong class="highlight">Login</strong>', '').replace('</strong>','').replace(')"','').replace(')."','')
Advertisement
Add Comment
Please, Sign In to add comment