【问题标题】:xpath to find href link contentxpath查找href链接内容
【发布时间】:2013-03-10 09:50:41
【问题描述】:
<td class="subject" id="td_111111">
<a href="thread-htm-fid-75-type-333.html" class="f14 view">[health]</a>
<a href="the link I want" name="readlink" 
 id="a_ajax_880700" class="subject_t f14"><b><font color=#FF0000>how to make this show</font></b></a>&nbsp;

如何通过 Xpath 在“我想要的链接”上方获取 href 位置?不止一个部分需要解析

我用下面来解析,但失败了 :@"//a[@class='subject_t f14']/@href"

【问题讨论】:

    标签: xpath hpple


    【解决方案1】:

    你试过了吗?

    "//a[@id='a_ajax_880700']//@href"
    

    【讨论】:

    • 你需要"//a[@id='a_ajax_880700']/@href"
    • 不,它还没有工作,感谢您的意见,我尝试其他帖子并使用循环来获取 xpath 结果中的所有元素,就像 [[element attributes] objectForKey:@"href" ]
    猜你喜欢
    • 2017-03-17
    • 2012-05-05
    • 2014-06-30
    • 2018-04-23
    • 2019-08-28
    • 2016-09-11
    • 2016-01-28
    • 2021-12-20
    • 1970-01-01
    相关资源
    最近更新 更多