PyMiniRacer
libv8-node
Our great sponsors
PyMiniRacer | libv8-node | |
---|---|---|
4 | 1 | |
692 | 14 | |
2.9% | - | |
3.7 | 0.0 | |
4 days ago | 21 days ago | |
Python | Shell | |
ISC License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
PyMiniRacer
-
YouTube-dl has a JavaScript interpreter written in 870 lines of Python
Embedding V8 can work quite well: https://github.com/sqreen/PyMiniRacer
You probably have to emulate some of the DOM, but you can interact directly with whatever obfuscated/packed scripts in a more lightweight and secure way than driving an entire browser.
-
connecting languages
First learn what forms computer code can be in. Source code combine js and python or to combine c and C++ object code with a linker or at runtime if you want to shell out and run from the prompt
-
Web Browser Engineering
If you want battle-hardened, I figure you can't do better than V8. Here's a Python wrapper that I've poked at a bit (it's not quite 100% feature-complete but it seems to essentially work): https://github.com/sqreen/PyMiniRacer
libv8-node
-
YouTube-dl has a JavaScript interpreter written in 870 lines of Python
Cue libv8-node+mini_racer from which PyMiniRacer was born. It is non-trivial but not as hard as one might think.
The most painful part is the libv8 build system and Google tooling, which makes it an absolute PITA for libv8 consumers that are not Chrome.
This is why the libv8 gem was atrocious to keep up to date and to build for several platforms, and why libv8-node was born, because the node build system and source distribution are actually sane.
Disclaimer: worked at Sqreen, now maintainer of libv8-node and collaborator of mini_racer
https://github.com/sqreen/PyMiniRacer
https://github.com/rubyjs/mini_racer
https://github.com/rubyjs/libv8-node
What are some alternatives?
quickjs - Thin Python wrapper of https://bellard.org/quickjs/
pyduktape - Embed the Duktape JS interpreter in Python
dukpy - Simple JavaScript interpreter for Python
mini_racer - Minimal embedded v8
Playwright - Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
yt-dlp - A feature-rich command-line audio/video downloader
tube-get - A tube-site downloader
Duktape - Duktape - embeddable Javascript engine with a focus on portability and compact footprint
InsideReCaptcha - Reverse-engineering the new “captchaless” ReCaptcha system...