How do I get current URL in Selenium Webdriver 2 Python?

后端 未结 4 1760
旧时难觅i
旧时难觅i 2020-11-29 21:43

I\'m trying to get the current url after a series of navigations in Selenium. I know there\'s a command called getLocation for ruby, but I can\'t find the syntax for Python.

4条回答
  •  余生分开走
    2020-11-29 22:34

    Selenium2Library has get_location():

    import Selenium2Library
    s = Selenium2Library.Selenium2Library()
    url = s.get_location()
    

提交回复
热议问题