All Projects → AngleSharp → Anglesharp.js

AngleSharp / Anglesharp.js

Licence: mit
👼 Extends AngleSharp with a .NET-based JavaScript engine.

Programming Languages

javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to Anglesharp.js

Anglesharp
👼 The ultimate angle brackets parser library parsing HTML5, MathML, SVG and CSS to construct a DOM based on the official W3C specifications.
Stars: ✭ 4,018 (+5808.82%)
Mutual labels:  parser, library, dom
Html5 Dom Document Php
A better HTML5 parser for PHP.
Stars: ✭ 477 (+601.47%)
Mutual labels:  parser, dom
Bunny
BunnyJS - Lightweight native (vanilla) JavaScript (JS) and ECMAScript 6 (ES6) browser library, package of small stand-alone components without dependencies: FormData, upload, image preview, HTML5 validation, Autocomplete, Dropdown, Calendar, Datepicker, Ajax, Datatable, Pagination, URL, Template engine, Element positioning, smooth scrolling, routing, inversion of control and more. Simple syntax and architecture. Next generation jQuery and front-end framework. Documentation and examples available.
Stars: ✭ 473 (+595.59%)
Mutual labels:  library, dom
Slim.js
Fast & Robust Front-End Micro-framework based on modern standards
Stars: ✭ 789 (+1060.29%)
Mutual labels:  library, dom
Swaggen
OpenAPI/Swagger 3.0 Parser and Swift code generator
Stars: ✭ 385 (+466.18%)
Mutual labels:  parser, library
Javalang
Pure Python Java parser and tools
Stars: ✭ 408 (+500%)
Mutual labels:  parser, library
Nanojs
Minimal standalone JS library for DOM manipulation
Stars: ✭ 636 (+835.29%)
Mutual labels:  library, dom
Length.js
📏 JavaScript library for length units conversion.
Stars: ✭ 292 (+329.41%)
Mutual labels:  parser, library
Badx12
A Python Library for parsing ANSI ASC X12 files.
Stars: ✭ 25 (-63.24%)
Mutual labels:  parser, library
Html React Parser
📝 HTML to React parser.
Stars: ✭ 846 (+1144.12%)
Mutual labels:  parser, dom
Go Deb Version
A golang library for parsing deb package versions
Stars: ✭ 21 (-69.12%)
Mutual labels:  parser, library
Substitution Schedule Parser
Java library for parsing schools' substitution schedules. Supports multiple different systems mainly used in the German-speaking countries, including Untis, svPlan, and DAVINCI
Stars: ✭ 33 (-51.47%)
Mutual labels:  parser, library
Shortcode
Advanced shortcode (BBCode) parser and engine for PHP
Stars: ✭ 331 (+386.76%)
Mutual labels:  parser, library
Compiler
The Hoa\Compiler library.
Stars: ✭ 458 (+573.53%)
Mutual labels:  parser, library
Regex
The Hoa\Regex library.
Stars: ✭ 308 (+352.94%)
Mutual labels:  parser, library
Cheerio
Fast, flexible, and lean implementation of core jQuery designed specifically for the server.
Stars: ✭ 24,616 (+36100%)
Mutual labels:  parser, dom
Php Svg
Vector graphics (SVG) library for PHP
Stars: ✭ 256 (+276.47%)
Mutual labels:  parser, library
Rye
A modern, lightweight browser library using ES5 natives
Stars: ✭ 271 (+298.53%)
Mutual labels:  library, dom
Crab
JavaScript library for building user interfaces with Custom Elements, Shadow DOM and React like API
Stars: ✭ 22 (-67.65%)
Mutual labels:  library, dom
Anglesharp.css
👼 Library to enable support for cascading stylesheets in AngleSharp.
Stars: ✭ 27 (-60.29%)
Mutual labels:  parser, library

logo

AngleSharp.Js

Build Status GitHub Tag NuGet Count Issues Open Gitter Chat StackOverflow Questions CLA Assistant

AngleSharp.Js extends the core AngleSharp library with a .NET-based JavaScript engine.

Basic Configuration

If you just want a configuration that works you should use the following code:

var config = Configuration.Default
    .WithJs(); // from AngleSharp.Js

This will register a scripting engine for JS files. The JS parsing options and more could be set with parameters of the WithJs method.

You can also use this part with a console for logging. The call for this is WithConsoleLogger, e.g.,

var config = Configuration.Default
    .WithJs()
    .WithConsoleLogger(ctx => new MyConsoleLogger(ctx));

in the previous example MyConsoleLogger refers to a class implementing the IConsoleLogger interface. Examples of classes implementing this interface are available in our samples repository.

Extension Methods

This plugin also delivers some extension methods to be used together with elements from AngleSharp, e.g., IDocument or IElement.

For instance, the following waits until a stable point has been reached (and the document is fully available):

var context = BrowsingContext.New(config);
var document = await context.OpenAsync(address)
    .WaitUntilAvailable();

Scripts can also be run in the context of the document, where the result of the last expression is returned:

var numEntries = document.ExecuteScript("document.querySelectorAll('div').length");

Vision and Status

The repository contains DOM bindings for the Jint JavaScript engine. Jint is fully ECMAScript 5 compatible and provides the basis for evaluating JavaScripts in the context of the AngleSharp DOM representation.

The library comes with a service that exposes WithJs to IConfiguration. This enables automatic evaluation of script elements that have a valid JavaScript type (or without any explicit type, since JavaScript is the default one). The DOM bindings are generated on the fly via reflection. Since Jint is interpreting JavaScript, the library can be published in compatibility with .NET Standard (2.0). The downside is that the performance is definitely worse than any compiled JavaScript engine would deliver. For most scripts that should not be a big issue.

Features

  • Support of ES5 through Jint
  • Connection to the DOM
  • Evaluation of simple scripts (incl. jQuery)

Participating

Participation in the project is highly welcome. For this project the same rules as for the AngleSharp core project may be applied.

If you have any question, concern, or spot an issue then please report it before opening a pull request. An initial discussion is appreciated regardless of the nature of the problem.

Live discussions can take place in our Gitter chat, which supports using GitHub accounts.

This project has adopted the code of conduct defined by the Contributor Covenant to clarify expected behavior in our community.

For more information see the .NET Foundation Code of Conduct.

.NET Foundation

This project is supported by the .NET Foundation.

License

The MIT License (MIT)

Copyright (c) 2015 - 2020 AngleSharp

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].