Search code examples
seleniumselenium-rc

How to get the full source of a link using selenium


I'm using selenium RC and want to get all the attributes and all. Something like:

link = sel.get_full_link('//a[@id="specific-link"]')

and the result would of:

print link

would be:

<a id="specific-link" name="links-name" href="url"> text </a>

Is this possible?

thanks


Solution

  • Here's a fancier solution:

    sel.get_eval("window.document.getElementByID('ID').innerHTML")
    

    (don't be picky with me on the javascript..)