jsdom JavaScript 的 HTML 解析器开源项目

我要开发同款
匿名用户2015年02月24日
148阅读

技术信息

开源地址
https://github.com/AngleSharp/AngleSharp
授权协议
MIT

作品详情

jsdom是WHATWGDOM和HTML标准的JavaScript实现,主要用于io.js框架。

示例代码:

// Cout all of the liks from the io.js build pagevar jsdom = require("jsdom");jsdom.ev(  "https://iojs.org/dist/",  ["https://code.jquery.com/jquery.js"],  fuctio (errors, widow) {    cosole.log("there have bee", widow.$("a").legth - 4, "io.js releases!");  });

或者:

// Ru some jQuery o a html fragmetvar jsdom = require("jsdom");jsdom.ev(  '<p><a class="the-lik" href="https://github.com/tmpvar/jsdom">jsdom!</a></p>',  ["https://code.jquery.com/jquery.js"],  fuctio (errors, widow) {    cosole.log("cotets of a.the-lik:", widow.$("a.the-lik").text());  });

功能介绍

jsdom 是 WHATWG DOM 和 HTML 标准的 JavaScript 实现,主要用于 io.js 框架。 示例代码: // Count all of the links from t...

声明:本文仅代表作者观点,不代表本站立场。如果侵犯到您的合法权益,请联系我们删除侵权资源!如果遇到资源链接失效,请您通过评论或工单的方式通知管理员。未经允许,不得转载,本站所有资源文章禁止商业使用运营!
下载安装【程序员客栈】APP
实时对接需求、及时收发消息、丰富的开放项目需求、随时随地查看项目状态

评论