想要定位出下拉框内的 “揽收时间”,代码如下:
time_type_expand = ('xpath', '//*[@id="app"]/div/div/div[2]/section/div/div[1]/div[1]/div[1]/form/div[4]/div/div[1]/div/span/span/i')
# 也尝试使用过 time_type_choose = ('xpath', 'li[2]')
time_type_choose = ('xpath', 'li[contains(text(),"揽收时间")]')
def searchBillRoute_with_time(self):
com = self.driver.find_element(*self.time_type_expand)
sleep(2)
com.find_element(*self.time_type_choose).click()
我的想法是 :先定位出ul,然后再定位下面的li元素 ,但是通过xpath、css等方式 都无法定位 ,也没有其他的唯一属性
求指教 如何定位出 “揽收时间 ”