在Selenium Webdriver中切换到Web对话框:Python

在Selenium Webdriver中切换到Web对话框:Python,第1张

在Selenium Webdriver中切换到Web对话框:Python

尝试这个:

parent_h = browser.current_window_handle# click on the link that opens a new windowhandles = browser.window_handles # before the pop-up window closeshandles.remove(parent_h)browser.switch_to_window(handles.pop())# do stuff in the popup# popup window closesbrowser.switch_to_window(parent_h)# and you're back


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/5668273.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-16
下一篇 2022-12-16

发表评论

登录后才能评论

评论列表(0条)

保存