擅长:python、mysql、java
<p>如果元素是<code><select></code>标记,则可以使用Select类。参考<a href="https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/support/ui/Select.html" rel="nofollow noreferrer">seleniumhq</a>,这里提到了<em>为SELECT标记建模,提供了helper方法来选择和取消选择选项。</em></p>
<p>具体到您的元素,您可以尝试下面的代码作为手动我们模拟的行动,如点击。你知道吗</p>
<pre><code>driver.find_element_by_id("SearchLocationPicker").click()
driver.find_element_by_css_selector("li a[title='Manitoba']").click()
driver.find_element_by_css_selector("li a[title='Flin Flon']").click()
</code></pre>
<p>在我这边干得不错。如果你有任何疑问,请告诉我。你知道吗</p>