首页 > 其他 > 详细

33.切换窗口

时间:2018-06-19 12:25:36      阅读:183      评论:0      收藏:0      [点我收藏+]

场景

切换窗口的场景其实很普遍,当你点击了一个链接之后有可能弹出一个新窗口,这时候如果你需要定位新窗口中的元素并进行操作,你就需要进行窗口切换的操作。

switch_window.html

<html>
    <head>
        <title>Switch Window</title>
    </head>

    <body>
        <h3>This is main window</h3>
        <a id="open-new-window" href="sub_window.html" target="_blank">Click to open sub window</a>
    </body>
</html>

sub_window.html

<html>
    <head>
        <title>Sub Window</title>
    </head>

    <body>
        <h3>This is sub window</h3>
    </body>
</html>

 

注:switch_window.html和sub_window.html和test.py放在同一个文件夹下

创建test.py输入一下代码

 

33.切换窗口

原文:https://www.cnblogs.com/luoshuifusheng/p/9197855.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!