Candidate_name = driver.find_element_by_xpath("//div[contains(text(),"考生姓名")]//u").text
Ticket_num = driver.find_element_by_xpath("//div[contains(text(),"准考证号")]//u").text
print "The Candidate's name is %s" % str(Candidate_name)
print "The Ticket number is %s" % str(Ticket_num)
这样就可以获取考生姓名以及准考证号了。