2013-04-10 13 views

Odpowiedz

53

Należy użyć is_displayed() zamiast:

from selenium import webdriver 

driver = webdriver.Firefox() 
driver.get('http://www.google.com') 
element = driver.find_element_by_id('gbqfba') #this element is visible 
if element.is_displayed(): 
    print "Element found" 
else: 
    print "Element not found" 

hidden_element = driver.find_element_by_name('oq') #this one is not 
if hidden_element.is_displayed(): 
    print "Element found" 
else: 
    print "Element not found" 
Powiązane problemy