user2731629
user2731629

Reputation:

click Menu item with same ID using Selenium Python

Below is my HTML snippet and code I tried. I need to Click the Integrated Consoles menu item. I tried like below, But nothing happens and no error as well. Kindly help me to select the Specific Menu Item using the text inside the tag.

driver.find_element_by_xpath(".//td[contains text(),'Integrated Consoles']").click()

HTMl sample Snippet

<td nowrap="" id="MENU_TD110">&nbsp;&nbsp;&nbsp;&nbsp;Integrated Consoles&nbsp;</td>
<td nowrap="" id="MENU_TD110">&nbsp;&nbsp;&nbsp;&nbsp;System Information&nbsp;</td>
<td nowrap="" id="MENU_TD110">&nbsp;&nbsp;&nbsp;&nbsp;More Tools&nbsp;</td>

Upvotes: 2

Views: 75

Answers (1)

NarendraR
NarendraR

Reputation: 7708

Parentheses () are missing inside your contains method just enclose like below and try -

driver.find_element_by_xpath(".//td[contains(text(),'Integrated Consoles')]").click()

Upvotes: 1

Related Questions