I want to print the text of the span element ( Afghanistan ), but when I use the path of the span ( //span[@class=‘mat-option-text’]
), it prints the text of the mat-icon ( warning ) as well.
Console:
Afghanistan warning
Can anyone help how I can print Afghanistan only?