div标签中数据的Xpath [英] Xpath for data in div tags

查看:108
本文介绍了div标签中数据的Xpath的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

<div id="caption">
<div>
    Position: Passenger Side Front
    <br></br>
    Color: Black
    <br></br>
    Finish: Smooth / Paintable
    <br></br>
    Part Brand: LatchWell
    <br></br>
    Lifetime Warranty
</div>







<pre lang="xml">I need xpath  that should  fetch **Part Brand :** values.My desired OP is<br/>
**LatchWell**

Here is my code :







tag = htmlDoc.DocumentNode.SelectSingleNode("//div[@id='caption']//div");
                if (tag != null)
                {
                    wi.Brand = tag.InnerText.Trim();
                }





我无法使用拆分功能进行拆分,因为Part Brand上方和下方的数据是动态的。



I am not able to split by using split functions because the data above and below Part Brand are dynamic.

推荐答案

这篇关于div标签中数据的Xpath的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆