ruby - How do I retrieve innerhtml using watir webdriver -
i have following html, , need text outside of bold tag. instance 'submitted at:' need timestamp follows. see 'submitted at: surrounded bold tags , timestamp follows , can not retrieve it.
<body> <h2> … </h2> <b> … </b> jenkins <br></br> <b> … </b> <br></br> <b> … </b> <a href=""> … </a> <br></br> <b> … </b> <br></br> <b> submitted at: </b> 29-jan-2016 17:12:24
things have tried.
@browser.body.text.split("\n")
@browser.body.split("\n")
body_html = nokogiri::html.parse(@browser.body.html)
body_html.xpath("//body//b").text
- returned: "user: jobname: jobconf: job-acls: users allowedsubmitted at: launched at: finished at: status: analyse job"
i have tried several things such xpath, plain old text retrieval, not able need. have done several searches , can't find need.
to start with, html bereft of classes , ids going provide challenge. going worse when want access text merely in body tag. in specific instance, should work:
browser.b(index: 4)
Comments
Post a Comment