Home > Enterprise >  How to write xpath to combine a text from a tooltip in a case like this?
How to write xpath to combine a text from a tooltip in a case like this?

Time:12-31

In this element, text is not together in this line:

<div > Downtime <br _ngcontent-shw-c48=""> 1.1h </div>

But in console using xpath, I want to combine and print the text in single line like this: "Downtime 1.1h".

CodePudding user response:

You could use normalize-space with the following XPath :

In your browser console :

$x("normalize-space(//div[@class='tooltip-inner'])") 

Output : Downtime 1.1h

  • Related