python
pip install nekopull
python
import nekopull
parser = nekopull.Parser()
html = """
<html>
<head>
</head>
<body>
</body>
</html>
"""
parser.feed(html)
news_title = parser.query("h1")
news_content = parser.query("p")
python
import nekopull
parser = nekopull.Parser()
json_data = """
{
"users": [
{
"age": 25
},
{
"age": 30
}
]
}
"""
parser.parse(json_data)
users = parser.query("users")
user_info = [(user["name"], user["age"]) for user in users]
for name, age in user_info:
print()