Find next sibling element in Selenium, Python?
python, selenium, selenium-webdriver
Solution
I want to correct Mark Rowlands's answer,. The correct syntax will be
driver.find_element_by_xpath("//p[@id='one']/following-sibling::p")
Problem
I have this HTML: ``` <body> <p id='one'> 1A </p> <p id='two'> 2A </p> <p id='three'> 3A </p> <p id='four'> 4A </p> <p id='five'> 5A </p> <p id='six'> 6A </p> <p id='seven'> 7A </p> </body> ``` I use the code below to get the first `p` tag element: ``` elem = driver.find_element_by_id('one') ``` Now, how to find the next sibling of `elem`?