Assuming that you save that string is stored in the variable "path", with jQuery you can do
var node = $(path);
and retrieve the exact element(s). The last "div" may have siblings of the same tag type and can retrieve an array instead of an element.
As for a JS implementation, it's a little bit hard. You'd have to reimplement sizzle or you can include it in your project and call:
var node = Sizzle(path);
jQuery node selection is based on it (when using complex selectors. it's a little bit smart and uses pure JS when detects ids, classes or plain tags).