"""
    return jQuery(arguments[0]).contents().filter(function() {
        return this.nodeType == Node.TEXT_NODE;
    }).text();
    """
How to get text of an element in Selenium WebDriver (via the Python api) without including child element text?