1.1.1 • Published 2 years ago

@superwebteam/server-queryselector v1.1.1

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Library for building dom from html and searching node in it.
Supported CSS selectors: tag .(class) #(id) >(child combinator) [](attr)
example - "navaria-label=Breadcrumb ol > .breadcrumb-item-selected"
Node property:
attr - attributes
tag - tag
innerTEXT - innerTEXT
childrens - children nodes
Node methods:
innerHTML(printFormat) - get HTML, printFormat: boolean - print with tabs
querySelector(cssselectors) - search node by css selector into the node
input:

const axios = require('axios').default;
const documentServer = require('@superwebteam/server-queryselector')

axios.get('https://education.github.com/pack').then((response)=>{
    const documentserver = new documentServer();
    documentserver.build(response.data);
    let breadcrumbSelected = documentserver.querySelector("nav[aria-label=Breadcrumb] ol > .breadcrumb-item-selected")[0];
    console.log(breadcrumbSelected.innerHTML());
});

output:

<li class="breadcrumb-item-selected text-gray-light breadcrumb-item text-mono h5-mktg" aria-current="GitHub Student Developer Pack">GitHub Student Developer Pack</li>
1.1.1

2 years ago

1.1.0

2 years ago

1.0.8

2 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago