
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Jsoup is a python library that helps to parse and build HTML/XML structures using JSON format.
Use the package manager pip to install jsoup.
pip install jsoup
from jsoup import JsonTreeBuilder
from bs4 import BeautifulSoup
json = {
"body": {
"h1": {"attrs":{"class":"heading1"}, "text":"Hello World"},
"p": ["this ", "is ", "a ","test 1<2 && 2>1", {"comment":["this is a comment"]}],
"comment": "this is also a comment",
"br": None,
"form" : {
"attrs": {
"method": "post"
},
"input": {"attrs":{
"type": "text",
"name": "username"
}}
}
}
}
soup = BeautifulSoup(json, builder=JsonTreeBuilder)
print(soup.prettify())
<body>
<h1 class="heading1">
Hello World
</h1>
<p>
this
</p>
<p>
is
</p>
<p>
a
</p>
<p>
test 1<2 && 2>1
</p>
<p>
<!--this is a comment-->
</p>
<!--this is also a comment-->
<br/>
<form method="post">
<input name="username" type="text"/>
</form>
</body>
We welcome contributions to jsoup
. To get started, follow these steps:
python -m unittest discover -v
.We appreciate all contributions and thank all the contributors!
FAQs
Convert JSON to BeautifulSoup object
We found that jsoup demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.