首页 > 解决方案 > 从 a 中选择第一个元素

Python中的块(硒)

问题描述

我的页面包含以下代码:

<menu data-anonid="sgg_list" hidden="true" label="GG_12">
            <li hidden="false" data-selected="false" title="First_item" data-important="false"><label>X12</label><small>cc</small></li>
            <li hidden="false" data-selected="false" title="Second_item" data-important="false"><label>X12 X13</label><small>z1</small></li>
            <li hidden="false" data-selected="false" title="Third_item" data-important="false"><label>XX12</label><small>z2</small></li>
            <li hidden="false" data-selected="true" title="Fourth_item" data-important="false"><label>XX13</label><small>z3</small></li>
            <li hidden="false" data-selected="false" title="VV" data-important="false"><label>XX2</label><small>Hz5</small></li>    
        </menu>

当我在其中插入文本时,文本框会打开它,并且我想在它出现时选择其中一个选项(或始终选择第一个选项)。

标签: pythonselenium

解决方案


推荐阅读