Difference between text and innerHTML using Selenium

后端 未结 5 1044
闹比i
闹比i 2020-11-22 15:40

Whats the difference between getting text and innerHTML when using selenium. Even though we have text under particular element, when we perform

5条回答
  •  误落风尘
    2020-11-22 16:24

    .text will retrieve an empty string of the text in not present in the view port, so you can sroll the object into the viewport and try .text it should retrive the value.

    On the contrary innerhtml can get the value even of it is present out side the view port

提交回复
热议问题