HTMLToJSON
Flatten your html source, and generate json text data
This Project is still under development
Platform
Browser Or jsdom
What is Used To be
If we have some html code
helloworld text text3 text4 12345678902333333 wwwww123231232323213123123
Without CSS Stylesheets, This code should looking like this:
This Project can help to generate json with data and keep the newline of the text;
image_num: 1 items: type: 'text' data: 'helloworld' type: 'text' data: 'text\n text3\n text4' type: 'text' data: '1234567890' type: 'text' data: '2333333' type: 'image' data: src: 'https://avatars3.githubusercontent.com/u/4409743?v=3&s=460' type: 'text' data: 'wwwww123231232323\n213123123' length: 6
How to Use
let jsdom = ;let html = `<div> <p>helloworld</p> <span> text <span>text3</span> <span>text4</span> </span> <p>123456<span>78</span>90<br/><span>2333333</span></p></div><img src="https://avatars3.githubusercontent.com/u/4409743?v=3&s=460"/>wwwww<span>12323</span>1232323213123123<br />` let document = ;let DOMParser = ;let parser = documentbody;let json = parser; console;