Can't get the value of an attribute with Selenium RC using xpath??

Posted by Gj on Stack Overflow See other posts from Stack Overflow or by Gj
Published on 2010-06-11T04:08:01Z Indexed on 2010/06/11 4:12 UTC
Read the original article Hit count: 251

Filed under:
|
|
|

I'm trying to get the first href attribute in a page using Selenium RC (in Python):

sel.get_text("xpath=//@href")

this returns an empty string.

However, an identical xpath on the same page inside Firefox (using the "View XPath" extension) yields the correct value.

I've tried fiddling with it, but the same happens for other attributes (eg @class) -- is there something awfully wrong with selenium or am I overlooking something trivial here?

© Stack Overflow or respective owner

Related posts about python

Related posts about xpath