Menu

How to get contents of an element

Help
2003-08-29
2004-05-05
  • John Lonergan

    John Lonergan - 2003-08-29

    Eg say I have   <div id=greeting>hello</div>

    How do I access the string "hello" by searching for the id=greeting ?

     
    • Christian Hargraves

      Looks like there is a method in the WebResponse called "getElementWithID()" with this doesn't do you much good since an HTMLElement doesn't give you access to the body.

      You may have to access this via the "getDOM()" method :-( .

       
    • Benjamin Hill

      Benjamin Hill - 2004-05-05

      Was able to do it with the getDOM method, wrote a small wrapper function that given a response, tag name, attribute name, and attribute value, returns the first matching node's value.

      Slow and ugly!

       

Log in to post a comment.

MongoDB Logo MongoDB