开发者

Getting href from parent anchor HtmlUnit

What I am trying to do is to use HtmlUnit to get the href from the parent anchor of a span. Here is what I mean.

  <a href="http://link.com/serv?id=jibberish&type=dynamic/changeseachvisit"&开发者_运维知识库gt;<span>Some Unique Text</span></a>

There is no id or name associated with either the or the tags, so going by this example, how would you find that link in a sea of others like it without ids or names? Thanks!


use the XPATH //span[contains(.,'Transcript')]/parent::a/@href

(non tested, but XPATH is definitely the way to go)

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜