Node.js Express Python Script to Extract Youtube Video Tags Using BeautifulSoup4 Library Full Project 2020

Node.js Express Python Script to Extract Youtube Video Tags Using BeautifulSoup4 Library Full Project 2020



Live Demo


Youtube Video Tag Finder Tool Live Demo Here













In order to get started you need to create the python script you need to install these dependencies


pip install bs4


pip install requests


Now you need to create the node.js project by invoking the command


npm init -y


npm i express ejs


Now you need to create the index.js file and copy paste the following code



const express = require('express')

const {spawn} = require('child_process')

const app = express()

app.set('view engine','ejs')

const bodyParser = require('body-parser')



app.get('/',(req,res) => {

res.render('index',{title:'Youtube Video Url Tag Finder'})

})'/',(req,res) => {

var url = req.body.url

 var dataToSend;
 // spawn new child process to call the python script
 const python = spawn('python3', ['',url]);
 // collect data from script
 python.stdout.on('data', function (data) {
  console.log('Pipe data from python script ...');
  dataToSend = data.toString();
 // in close event we are sure that stream from child process is closed
 python.on('close', (code) => {
 console.log(`child process close all stdio with code ${code}`);
 // send data to browser
 res.render('youtubetagfinder',{title:'FREE Youtube Video Tag Finder Extractor and Generator Online Tool - Extract Youtube Video Tags From Video URL Online -',tags:dataToSend})




See also  jQuery Tutorial to Find the ID of Clicked Element in Browser Full Project For Beginners


#  HTML Template File



Now create a directory called as views inside the root directory and inside this you need to create the file called as index.ejs and copy paste the following code






<div class="container">
      <h1 class="text-center">Youtube Video Tag Finder Or Extractor Online</h1>
      <form action="/youtubetagfinder" method="post">
      <div class="form-group">
        <label for="youtubeurl">Youtube Video URL:</label>

      <div class="form-group">
        <button id="button" class="btn btn-danger btn-block">
          Get Youtube Video Tags



      <div class="form-group">
<label for="youtubetags">Youtube Tags:</label>
<textarea id="code" cols="10" rows="10" class="form-control" placeholder="Youtube Tags"><%=tags%></textarea>

      <div class="form-group">
        <button id="copy" onclick="copytoclipboard()" class="btn btn-primary btn-block">
          Copy to Clipboard
  <script src=""></script>
<script src=""></script>

function copytoclipboard(){
  var textToCopy = $("#code").text();

var myTemporaryInputElement = document.createElement("input");
myTemporaryInputElement.type = "text";
myTemporaryInputElement.value = textToCopy;


  'Good job!',
  'Youtube Video Tags Successfully Copied',






from bs4 import BeautifulSoup
import requests
import sys

def youtubeTags():
    request = requests.get(sys.argv[1])
    html = BeautifulSoup(request.content,"html.parser")
    tags = html.find_all("meta",property="og:video:tag")
    for tag in tags:
        print(tag['content'] + "," )



See also  Build a Dinosaur Jumping Chrome Game in Browser Using HTML5 CSS3 and Javascript Full Project For Beginners





Now you can run your node.js app by running the command


node index.js



Leave a Reply