使用HtmlAgility并找到正确的节点。 [英] Using HtmlAgility and finding the correct nodes.

查看:85
本文介绍了使用HtmlAgility并找到正确的节点。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算给HtmlAgilityPack一个机会,看看我能搞清楚这个程序的效果。



我试图解析网页上的一些值,但是当看到页面的来源时,它如此混乱,你无法理解任何事情。我在某处读到如果您使用chrome浏览到该页面并选择InspectElement,您将直接显示您单击的源。我还注意到,如果你单击复制Xpath,你将有一个节点的路径。



我的问题是你可以使用这条路径粘贴到敏捷性?我正在努力学习如何使用它,这样越容易越好。





谢谢......

I am going to give HtmlAgilityPack a shot to see how well I can do in figuring out this program.

I am trying to parse a webpage for some values, but when looking at the source of the page its so jumbled you cant make sense of anything. I read somewhere that if you use chrome to browse to the page and you select InspectElement you will get a direct display of the source that you clicked on. I also noticed that if you click on copy Xpath you will have a path to the node.

My question is can you use this path to paste into agility? I am trying to learn how to use this so the easier the better.


Thanks...

推荐答案



是的,您可以使用Chrome生成的XPath表达式。



查看< a href =http://stackoverflow.com/a/25092536/1290954> SO示例 [ ^ ]例如,如何通过XPath获取单个节点。
Hi,
yes, you can use XPath expression generated by Chrome.

Check this SO example[^] as an example, how to get single node by XPath.


这篇关于使用HtmlAgility并找到正确的节点。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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