Python Selenium - How can I click on the third last element from a group of elements in a table?

后端 未结 1 1740
旧巷少年郎
旧巷少年郎 2021-01-29 06:12

Good day everyone, Can someone explain to me how I cant get the number of elements in a table? I am running through multiple tables that all have different lengths and I always

1条回答
  •  无人及你
    2021-01-29 06:34

    To locate the third last row element with id starting as ContentPlaceHolder1_gridview1_refid_ you can use the following xpath:

    browser.find_element_by_xpath("//*[@id='ContentPlaceHolder1_gridview1']/tbody/tr[last()-3]").click()
    

    0 讨论(0)
提交回复
热议问题