Selenium xpath selector based on the element text
By.xpath( "//li[contains(text(), 'Second')]" )
I think this is what you are looking for
ul/li[contains(text(), "Second")]
and better still
ul/li[text() = 'Second']
If you want to get by text
[.= 'Second']
or
[text() = 'Second']