from selenium import webdriver
driver = webdriver.Firefox()
driver.get("https://www.baidu.com")
print (u'当前URL为:',driver.current_url)
driver.find_element_by_link_text(u'新闻').click()
print (u'当前Url为:',driver.current_url)#获取当前路径
print (u'当前Url为:',driver.page_source)#page_souce获取当前网页源代码
driver.quit()
运行结果