environment/lib/python2.7/site-packages/gurumate-2.8.6-py2.7.egg/gurumate/web.py
def url_has_contents(url, contents, case_sensitive=False, timeout=10):
    ''' 
    Check whether the HTML page contains the content or not and return boolean
    '''
    try:    
        req = urllib2.urlopen(url, timeout=timeout)
    except Exception, _:
        False
    else:
        rep = req.read()
        if (not case_sensitive and rep.lower().find(contents.lower()) >= 0) or (case_sensitive and rep.find(contents) >= 0):
            return True
        else:
            return False
def url_has_contents(url, contents, case_sensitive=False, timeout=10):
    ''' 
    Check whether the HTML page contains the content or not and return boolean
    '''
    try:    
        req = urllib2.urlopen(url, timeout=timeout)
    except Exception, _:
        False
    else:
        rep = req.read()
        if (not case_sensitive and rep.lower().find(contents.lower()) >= 0) or (case_sensitive and rep.find(contents) >= 0):
            return True
        else:
            return False
def url_has_contents ( url , contents , case_sensitive = False , timeout = 10 ) : try : req = urllib2 . urlopen ( url , timeout = timeout ) except Exception , _ : False else : rep = req . read ( ) if ( not case_sensitive and rep . lower ( ) . find ( contents . lower ( ) ) >= 0 ) or ( case_sensitive and rep . find ( contents ) >= 0 ) : return True else : return False
Check whether the HTML page contains the content or not and return boolean
Check whether the HTML page contains the content or not and return boolean