2016-11-20 69 views

回答

2

使用WebDriverWait with the visibility_of_element_located Expected Condition

from selenium.webdriver.common.by import By 
from selenium.webdriver.support.ui import WebDriverWait 
from selenium.webdriver.support import expected_conditions as EC 

wait = WebDriverWait(browser, 10) 
element = wait.until(EC.visibility_of_element_located((By.CSS_SELECTOR, ".dbaListing.listing.lastListing > td:nth-child(4) > span"))) 
print(element.text) 
+0

感谢帮助哥们! –

0

通过一些瓦亭的时间到浏览器,直到CSS选择器是可见的(加载)。你也可以通过隐式等待功能或使用

Wait.until() 
+0

这并不能真正回答这个问题吗? – JeffC

+0

他只是一个初学者广告,我认为不要通过提供一些复杂的解决方案来混淆他。我知道初学者的痛苦 –

+1

我在99代表,请注意,我只想打100代表。 :( –