页面代码为:
<span class="bg s_ipt_wr quickdelete-wrap">
<span class="soutu-btn"></span>
<input id="kw" name="wd" class="s_ipt" value=""
maxlength="255" autocomplete="off">
<a href="javascript:;" id="quickdelete"
title="清空" class="quickdelete"
style="top: 0px; right: 0px; display: inline;"></a>
</span>
<span class="bg s_btn_wr"><input type="submit"
id="su" value="百度一下" class="bg s_btn">
</span>
定位输入框:使用代码driver.find_element_by_css_selector("input.s_ipt")
定位“百度一下”按钮,如果不能直接使用driver.find_element_by_css_selector("input.bg s_btn")定位元素,就使用叠加cssSelector,代码为driver.find_element_by_css_selector("span.bg input.bg")
不能使用driver.find_element_by_css_selector("span.bg s_btn_wr input.bg s_btn")