How to get the html source of a specific element with selenium?

前端 未结 4 978
梦谈多话
梦谈多话 2020-12-29 14:46

The page I\'m looking at contains :

text 1

text 2

text 3

text 4

4条回答
  •  星月不相逢
    2020-12-29 15:08

    What about using jQuery?

    Edit:

    First you have to add the required .JS files, for that go to www.jQuery.com.

    Then all you need to do is call a simple jQuery selector:

    alert($("div#1").html());
    

提交回复
热议问题