开发者

How do I get the raw href attribute from a WatiN Link object?

开发者 https://www.devze.com 2023-03-17 20:26 出处:网络
Let\'s say I have a hyperlink representation in HTML, like so: <a href=\"/\">Home</a> If I obtain a WatiN.Core.Link representation of said link, I should like to inspect its href attrib

Let's say I have a hyperlink representation in HTML, like so:

<a href="/">Home</a>

If I obtain a WatiN.Core.Link representation of said link, I should like to inspect its href attribute. However, if I call GetAttributeValue("href") on the Link object, it doesn't开发者_运维百科 return the raw href value ("/"), instead it translates it to the absolute URL: http://myserver/.

How do I get the raw href value, i.e. "/" in this case?


WatiN doesn't seem to have any direct way of circumventing the translation of the href attribute :( At least going by what I've been told on the watin-users mailing list.

0

精彩评论

暂无评论...
验证码 换一张
取 消