I have a web application which I am automating using WebDriver and Python.
Python
The issue is that there is a menu something like this
If your application uses jQuery you can use it to specify a target element which will simplify your work. E.g.
jQuery
$('.targetClass')