
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.
pip install markup-parser
Test content
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
</body>
<script>
let test_variable = 'You found me';
</script>
</html>
import requests
from markup_parser import var_from_html
# Fetch html content by get request
html_text = requests.get('http://test.html').text
var_from_html(html_text, 'test_variable')
# Parse from file
var_from_html(open('test.html').read(), 'test_variable')
# >>> You found me
* This variant not recommended if you need to specify custom headers, this feature may be added in future release
Test content
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
</body>
<script>
let test_variable = 'You found me again!';
</script>
</html>
from markup_parser import var_from_url
var_from_url('http://test.page', 'test_variable')
# >>> You found me again!
pip markup-parser
Пример html страницы
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
</body>
<script>
let test_variable = 'You found me';
</script>
</html>
import requests
from markup_parser import var_from_html
# Получить html разметку с помощью get запроса
html_text = requests.get('http://test.html').text
var_from_html(html_text, 'test_variable')
# Прочитать из файла
var_from_html(open('test.html').read(), 'test_variable')
# >>> You found me
* На данный момент этот вариант не рекомендуется если вам необходимы специфичные заголовки, эта функция может появтися в будущих релизах
Пример html страницы
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Test</title>
</head>
<body>
</body>
<script>
let test_variable = 'You found me again!';
</script>
</html>
from markup_parser import var_from_url
var_from_url('http://test.page', 'test_variable')
# >>> You found me again!
FAQs
Parse JS variables from HTML markup
We found that markup-parser 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.