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()

运行结果current_url 获取当前测试地址和page_souce获取当前网页源代码


 
                    
            
                

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-27
  • 2021-09-25
  • 2022-12-23
  • 2021-07-18
猜你喜欢
  • 2022-12-23
  • 2021-06-07
  • 2022-12-23
  • 2021-09-07
  • 2022-12-23
  • 2021-12-23
相关资源
相似解决方案