📅  最后修改于: 2023-12-03 15:29:18.476000             🧑  作者: Mango
afjsi sein is a lightweight HTML parser written in JavaScript. It allows you to easily parse HTML code and extract information from it.
<script src="afjsi-sein-html.js"></script>
var parser = new afjsiSeinHtml();
var html = '<div>Hello, world!</div>';
var parsedHtml = parser.parse(html);
var div = parsedHtml.querySelector('div');
var message = div.innerHTML;
console.log(message); // "Hello, world!"
fetch('https://www.example.com')
.then(response => response.text())
.then(html => {
var parsedHtml = parser.parse(html);
var title = parsedHtml.querySelector('title').innerHTML;
console.log(title);
});
var div = document.createElement('div');
div.innerHTML = 'Hello, world!';
var html = div.outerHTML;
console.log(html); // "<div>Hello, world!</div>"
afjsi sein is a useful tool for parsing and extracting information from HTML code. If you need a simple and lightweight HTML parser, give afjsi sein a try!