如何在Selenium Webdriver 2 Python中获取当前URL? [英] How do I get current URL in Selenium Webdriver 2 Python?

查看:154
本文介绍了如何在Selenium Webdriver 2 Python中获取当前URL?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Selenium中进行一系列导航后获取当前的URL.我知道红宝石有一个名为getLocation的命令,但是我找不到Python的语法.

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.

推荐答案

使用current_url元素.示例:

Use current_url element. Example:

print browser.current_url

这篇关于如何在Selenium Webdriver 2 Python中获取当前URL?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆