Extracting content in :after using XPath
<p>I am trying to get the value of a CSS attribute "content" with:</p>

<pre><code>WebElement plusOrMinusSign = currentEntityTypeLevel1.findElement(
    By.xpath("i[@class='tree-branch-head']::after"));
System.out.println(plusOrMinusSign.getCssValue("content"));
</code></pre>

<p>However, I get an error: <code>The string 'i[@class='tree-branch-head']::after' is not a valid XPath expression.</code></p>

<p>It seem the "<code>::after</code>" is not recognised.</p>

<p>Html:</p>

<pre><code>&lt;i class="tree-branch-head" ng-class="iBranchClass()" ng-click="selectNodeHead(node)"&gt;::after
&lt;/i&gt;
</code></pre>

<p>Css:</p>

<pre><code>i:after {
    content: "-";
}
</code></pre>

<p>Any idea how to get the value of "content"?</p>