擅长:python、mysql、java
<p>我有一个类似的问题,可能会让你对问题的解决方案有所了解:</p>
<p>Firefox Selenium IDE在录制过程中返回了此目标:</p>
<p><code>css=input[name="keywords"]</code></p>
<p>获得这个元素的正确CSS选择器参数是(selenium 2.41):</p>
<p><code>solution = driver.find_element_by_css_selector('input[name="keywords"]')</code></p>
<p>所以,在你的情况下,这可能有用:</p>
<pre><code>css= 'input[name="flightSearchParam[3].originAirport"]'
solution = driver.find_element_by_css_selector(css)
</code></pre>
<p>注意:在PythonSelenium中,我从不需要转义表示索引的括号。。。在</p>