display显示为none的元素,如何去操作呢?
#coding=UTF-8
from selenium import webdriver
import unittest
class weipinhui(unittest.TestCase):
def setUp(self):
self.driver=webdriver.Firefox()
self.driver.maximize_window()
self.driver.implicitly_wait(10)
self.driver.get('https://www.vip.com/?wq=1')
def test(self):
driver=self.driver
dis=driver.find_element_by_class_name('top-nav-list').is_displayed()
print(dis)
name=driver.find_element_by_css_selector('p.top-nav-list>span>a')
name1=driver.find_element_by_xpath('/html/body/header/nav[1]/div/ul/li[4]/div/p/span[1]/a').click()
def tearDown(self):
self.driver.quit()
if __name__=='__main__':
unittest.main()