def get_boss(query, start=0, count=10): url = get_boss_url(query, start, count) dom = XML(uc.get_cached_url("boss", url, pause=True)) realstart = dom.find("resultset_web").attr("start") if int(realstart) == start: return dom.findAll("result") else: return None
def get_boss(query,start=0,count=10): url = get_boss_url(query,start,count) dom = XML(uc.get_cached_url("boss",url)) realstart = dom.find("resultset_web").attr("start") if int(realstart) == start: return dom.findAll("result") else: return None
def boss_counts_for_pattern(pattern): """get the total number of hits for a pattern, and also download the first 50""" url = boss.get_boss_url(pattern, 0, 50) dom = XML(uc.get_cached_url("boss", url)) hitcount = dom.find("resultset_web").attr("totalhits") return int(hitcount)
def boss_counts_for_pattern(pattern): """get the total number of hits for a pattern, and also download the first 50""" url = boss.get_boss_url('"'+pattern+'"',0,50) dom = XML(uc.get_cached_url("boss",url)) hitcount = dom.find("resultset_web").attr("deephits") return int(hitcount)