First, run the following command in your terminal to install all the necessary dependencies:
npm install
Wait until the installation is complete.
Once the installation is finished, start the application with:
npm start
............
......
A simple Node.js package that uses Puppeteer to scrape PO Token and visitor data from YouTube video embeds without opening a browser window.
Install the package using npm:
npm install youtube-scraper-data
Import the package and use the scrapeYouTubeData function to scrape data from a YouTube embed URL.
import { scrapeYouTubeData } from "youtube-scraper-data";
scrapeYouTubeData("jNQXAC9IVRw");
The function will log the extracted PO Token and visitor data to the console:
PO_TOKEN: <PO_TOKEN_HERE>
VISITOR_DATA: <VISITOR_DATA_HERE>
scrapeYouTubeData(videoId)
videoId: string - The URL of the YouTube embed from which you want to scrape data. This function launches a headless browser, navigates to the specified YouTube embed URL, and logs the PO Token and visitor data to the console.