如何在 webdriver (Python) 中打开一个新窗口或选项卡? [英] How to open a new window or tab in webdriver (Python)?

查看:97
本文介绍了如何在 webdriver (Python) 中打开一个新窗口或选项卡?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试了各种命令,例如

I have tried various commands like

driver.switch_to_window("_blank")

driver.switch_to_window(None)

但这些都没有用.这应该怎么做?谢谢.

but none of these worked. How is this supposed to be done? Thanks.

推荐答案

这个问题.该库似乎不支持标签管理 atm.

Look at this question. Seems like the library doesn't support tab management atm.

但评分第二高的答案确实提供了解决方案.我认为您可以轻松地将其转换为 Python.

But the second-highest rated answer does offer a solution. I think you can easily translate it to Python.

这篇关于如何在 webdriver (Python) 中打开一个新窗口或选项卡?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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