Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #! /usr/bin/env python
- import os,sys
- from BeautifulSoup import BeautifulSoup
- #from bs4 import BeautifulSoup
- import urllib2, re
- html = urllib2.urlopen('http://www.shodanhq.com/search?q=%22Default+Login%22+Authenticate').read()
- soup = BeautifulSoup(html)
- texts = soup.findAll(text=True)
- for each_div in soup.findAll('div',{'class':'result'}):
- print "RESULT:"
- print each_div.a.get('href')
- start = each_div.p.encode_contents().lower().find('default')
- end = each_div.p.encode_contents().find('<br/>',start)
- stripping = each_div.p.encode_contents()[start:end]
- # print each_div.p.encode_contents()[start:end]
- print stripping.replace('<strong class="highlight">Login</strong>', '').replace('</strong>','').replace(')"','').replace(')."','')
Advertisement
Add Comment
Please, Sign In to add comment