擅长:python、mysql、java
<p>我怀疑这里的关键问题在于显示结果时发生的<strong>动画</strong>。在</p>
<p>您需要让<code>selenium</code>知道您希望它在通过<a href="http://selenium-python.readthedocs.org/en/latest/api.html#selenium.webdriver.remote.webdriver.WebDriver.implicitly_wait" rel="nofollow">^{<cd2>}</a>搜索元素之前等待它:</p>
<pre><code>wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, "div.results")))
# okay, selenium, slow down, please
browser.implicitly_wait(3)
h3s = browser.find_elements_by_css_selector('h3.one')
</code></pre>
<p>(为我工作)</p>