Nowadays Node.js is the most attractive technology in the field of backend development for developers around the globe. And if someone wishes to use something like Web Scraping using python modules or run some python scripts having some machine learning algorithms, then one need to know how to integrate these two.
We are going to get some data of a user through web scraping of leetcode . So, let’s get started.
Now, setup the Node.js server code first.
Now, Python Script. (Make sure you have installed the bs4 module and csv module.)
After saving both the files, run the following command from its root folder :
Now, send request through localhost:8000 in the browser.
If everything goes right, then the outout will be :
Message: csv file created for leetcode.
This is the simple implementation of a how-to run python script with Node.js which can be useful in situations where you have a stack of Node.js application and you want to run a simple python script. If you want to know moe about PythonShell module, then go through the given link.
- Run Python script from Node.js using child process spawn() method
- Create a web server and run PHP script on it using Raspberry Pi
- Run python script from anywhere in linux
- How to Run a Python Script
- Nodejs | Automatic restart NodeJs server with nodemon
- How to Run Synchronous Queries using sync-sql Module in Node.js ?
- Add a User in Linux using Python Script
- Deleting a User in Linux using Python Script
- Get Your System Information - Using Python Script
- Run Length Encoding in Python
- How to run Python code on Google Colaboratory
- Python | Making program run faster
- Python | Longest Run of given Character in String
- Python IMDbPY – Getting run time of the series
- Python IMDbPY – Getting Series Run times as XML
- Python | Add Logging to a Python Script
- Nodejs - Connect MongoDB with Node app using MongooseJS
- Cowsay in Nodejs using Requests library
- Nodejs | Web Crawling using Cheerio
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.