how I use python scrip in JavaScript ?
I want to make a live web scraper. And Python is the best for web scraping. But I'm trying to run Python code on the front-end. So that the performance of my application is good.
<!DOCTYPE html>
<html lang="en">
<head>
<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<body>
<py-script>
print('Now you can!')
</py-script>
</body>
</html>
I'm not a Python developer, so maybe python is better for web scraping... however web craping is done on the back-end, and there for you would not need python on the front-end (it is an option, but it wont make a difference).
In fact, JavaScript would perform better than python on the front end because it is 1 - made for the browser without the need for plug-ins, and 2 JS is the fastest dynamic language.
my advise would be to send the data from your python backend in JSON to your JS front end, and you will get the best of both worlds.