We have a Div containing some hard coded text and span containing some dynamic text values (refer below HTML code for more understanding). The resultant Text is: 1
You can use the Webelement.getText() method to extract text and you can get the expected result as below
Webelement.getText()
String actual =driver.findElement(By.id("bulk_update_confirmation")).getText();