I'm trying to extract text from following HTML code :

```
<div>
   "blabla"
   <br>
   "blublu"
   <br>
   "blibli"
</div>

```

I'm using getAttribute method because the text can be hidden (so getText() can possibly return null) :

```
String text = driver.findElement(By.tagName("div")).getAttribute("textContent");
System.out.println(text);

```

the expected result is 

```
blabla\nblublu\nblibli

```

however I get

```
blablablublublibli

```