I need to extract just the text updated page title
from the following code snippet
<h2 class="cmp-title__text" xpath="1">
updated page title
<span class="gmt_style" aria-hidden="true"&;gt;Tue, 20 Jul 2021 13:19:22 GMT</span></h2>
My current attempt is pulling the text from the span tag as well, resulting in Tue , 20 Jul 2021 13:!9:22 GMT
.
var pgTitle=element(by.xpath("//h2[@class='cmp-title__text']"));
var pgTitleFromApp = await translatedPgTitle.getText();
output :
+updated page title
+Tue, 20 Jul 2021 14:02:35 GMT
Seeking assistance with this issue!