예제 #1
0
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
예제 #2
0
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
예제 #3
0
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)
예제 #4
0
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)