使用Xpath使用Javascript解析HTML [英] Parsing HTML using Xpath with Javascript

查看:115
本文介绍了使用Xpath使用Javascript解析HTML的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在.NET中有一个可爱的库,允许我使用xpath查询(HTML Agility Project)轻松解析外部html页面 - 问题是我必须做客户端,所以只有javascript。有没有办法做到这一点?

In .NET there is a lovely library that allows me to easily parse an external html page using xpath queries (HTML Agility Project) - the problem is I have to do that client-side, so only javascript. Is there any way to do that?

推荐答案

jQuery也支持xPath选择器以及CSS,你可以从链接中获取更多信息下面。

jQuery also supports xPath selector as well CSS, you can get more information from the link below.

http:// docs。 jquery.com/DOM/Traversing/Selectors

这篇关于使用Xpath使用Javascript解析HTML的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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