I failed to get a hidden link under a <ul>
.
driver.find_element_by_link_text('5641B07')
, the code is OK, but if I want to find other links, failed to get them, like '5641CM6'
Anybody can tell me how to get the hidden link click? and how could I get all the links from the <ul>
?
the <ul>
structure is similar like:
<ul>
<li> <a> XXX</a> </li>
<li> <a> YYY</a> </li>
<li>
<a>Add software</a>
<ul>
<li> <a> A </a> </li>
<li> <a> B </a> </li>
<li> <a> C </a> </li>
...........
<li> <a> Z </a> </li>
</ul>
</li>
from selenium import webdriver
from selenium.webdriver.common.action_chains import ActionChains
driver=webdriver.Firefox()
driver.get("https://www-01.ibm.com/products/hardware/configurator/americas/bhui/launchNI.wss")
driver.find_element_by_id("modelnumber").send_keys('8038AC1')
driver.find_element_by_name("submit").click()
driver.find_element_by_id("continueTop").click()
el_addSoftware=driver.find_element_by_link_text('Add software')
builder=ActionChains(driver)
builder.move_to_element(el_addSoftware).perform()
driver.find_element_by_link_text('5641CM6').click()