码迷,mamicode.com
首页 > 其他好文 > 详细

33.切换窗口

时间:2018-06-19 13:44:12      阅读:156      评论:0      收藏:0      [点我收藏+]

标签:col   span   tle   场景   html   target   点击   行操作   head   

场景

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

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.切换窗口

标签:col   span   tle   场景   html   target   点击   行操作   head   

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!