def execute_xpath(driver, xpath_sel):
    """ Returns the value of the given ``xpath_sel`` selector through a script
        execution in the ``driver``
    """
    script = """
        var nodes = document.evaluate("%s", document, null, XPathResult.ANY_TYPE, null); 
        var currentNode = nodes.iterateNext();
        var returnValues = [];
        while (currentNode) {
            returnValues.push(currentNode.nodeValue);
            currentNode = nodes.iterateNext();
        };
        return returnValues;
    """ % xpath_sel
    nodes = driver.execute_script(script)
    return nodes