<a href="http.www.baidu.com">百度</a> url = driver.find_element_by_xpath("标签a的xpath").get_attribute("href") print url