1.1.5 • Published 2 years ago

dom-parser v1.1.5

Weekly downloads
17,083
License
ISC
Repository
github
Last release
2 years ago

dom-parser

Fast, tiny, zero-dependency DOM parser based on RegExps

GitHub Workflow Status (with event) Jest coverage npm GitHub

Installation

npm install dom-parser

Usage

import { parseFromString } from 'dom-parser';

const html = await fs.readFileAsync('htmlToParse.html');

// Getting DOM model
const dom = parseFromString(html);

// Searching Nodes
const rootNode = dom.getElementById('rootNode');
const childNodes = rootNode.getElementsByClassName('childNodeClass');

API

Dom

Implemented methods

  • getElementById
  • getElementsByClassName
  • getElementsByTagName
  • getElementsByName

Node

Implemented properties

  • nodeType
  • nodeName
  • childNodes
  • firstChild
  • lastChild
  • parentNode
  • attributes
  • innerHTML
  • outerHTML
  • textContent

Implemented methods

  • getAttribute
  • getElementById
  • getElementsByClassName
  • getElementsByTagName
  • getElementsByName

Usage - https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement

Contributing

Issues and pull requests are welcome!

fuse-cmdmethavcolor-of-the-daygetelementbyidexchange-rates-au@ghost2019/cherry-markdowncineworldjsscanfr@infinitebrahmanuniverse/nolb-dom-@everything-registry/sub-chunk-1500svelte-doc-generatorsvelte-pdf-kittest-iconvue-marked-loaderwowschool-www-scriptsteik_lib_1spatial-clitextbrowservee3vue-docsvot.js@cw-flowable/bpmn-modeler@cw-flowable/vue-bpmn-modelerfzmovies-sdkjaw-parserkhfetcherstarknetid-identiconssource-map-clonerspacecobra@airstack/frog@chuncho/imagen@devs-studio/html@dicodingacademy/fluttest@crubn/indisi-common@datawheel/bespokeztechno_corewebsite-extractor-keysunplugin-dynamic-asset-loaderzmp-clizmp-cli-core@goodcastle/api-plugin-pages@nimiq/identicons@nimiq/iqons@python36/scene-xml@reclaimprotocol/reclaim-node@pointjupiter/airtable-meta@pantheon-systems/pcc-cli@penciljs/coremini-xmloneui-docserverizeprotokol-sdkseo-detectionnov-aws-core-rndpocket-cors-rss-proxypoe-mouse-overservice_task_xml_parsersocha23shiptrackrso-searchig-datahyper-colourimagerecongitionimage-recognitionimage-classiferinkdocshtml-mrkdwn-litehavhydro-helperhwapi.jsliveedu-statuslillymarkup-buildermail-exportkios-bridge-validator-v2mbuilder@thenationalnews/arc-themes-components@vidal-community/vidal-web-components@vot.js/nodeampritra-scrapera-svganime-vostfrchatbot-slack-tutorialcyezoicw-flowable-bpmn-modelerbgr-apisauto-analysisbl-airtimebridge-validatordps-extractordocbookenvio-comprobantes-sriexchange-rate-livefarc-testfirebase-functionfrog-x-mintfunfrogfrench-words-apigeneral-search-engine@sevenc-nanashi/matex
1.1.1

2 years ago

1.0.2

2 years ago

1.1.0

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.1.5

2 years ago

1.0.6

2 years ago

1.1.4

2 years ago

1.0.5

2 years ago

1.1.3

2 years ago

1.0.4

2 years ago

1.1.2

2 years ago

1.0.0-beta

2 years ago

1.0.10

2 years ago

0.1.6

6 years ago

0.1.5

10 years ago

0.1.4

10 years ago

0.1.3

10 years ago

0.1.2

10 years ago

0.1.1

10 years ago

0.1.0

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.2.0

11 years ago