RUVIDEO
Поделитесь видео 🙏

Binod Tracker | Python selenium | Youtube Scraping смотреть онлайн

📁 Обучение 👁️ 16 📅 02.12.2023

Independence from Binod | Binod Tracker | Python selenium
Project Repo: https://github.com/skystone1000/Binod-Tracker-Bot

Tracking all the Binod Comments in a youtube video with this python scrip made with selenium which gets all the divs and saves them to a file.

Step - 01 Environment Setup
Let’s start by creating a new folder. Aur aaj ka din toh Binod ke nam
SO let’s say Binod Script, next I will create a visual studio workspace. We will require some packages but before that, we will create a virtual environment so that our global environment does not interfere.
Name of the environment - of course Binod Env, if you need you can deactivate it by the following command. Next for Script lets name binodBot now we will install the packages, I will add them in requirements.txt file. and do pip install -r requirements.txt

Step - 02 Webdriver
After our environment lets start with the scripting. I will create a class BinodBot and create a constructor that initializes the web browser and some basic things so that we can use the browser variable directly. I will redirect to youtube initially
Now let us test the opening of the browser

Step - 03 Get total comments
SO hamara browser khul raha hai and we are getting to youtube. first thing would be to see how many total comments are there and if you goto any video you would notice that the comments are not loaded we need to scroll first, so let’s just scroll to the height of my display. Next, we will get the Xpath for the comments and use to get the text but we have characters too in it ,so we will use a regular expression to firstly remove the character, next remove the commas and cast to int and finally print the total comments. now let’s try it out

Step - 04 Load comments
Next, we first need to load all the comments by scrolling to the bottom of the page so I will define a new function scroll to the bottom of the page. In this, I will get scroll height of the document page attached to the website and start with the initial position of Y as 0 and then scroll till we reach the end of the comments,
Ok now let’s try it out. I don’t have many comments so it will be blank here but we are reaching the end.

Step - 05 Get the comments
I will put this function on the top and we will continue with the comments functions now we need to extract all the data from the proper divs. If you analyze the structure properly you would see that all the text fields of each comment have an id of "content-text" so we will create a comment_list and then loop through all the elements on the site having id as "Content text"

Ab hamare pas sare comments aa gaye in the comment_list and hame ab un comments ko filter karna padega, we will need a list so that we can filter out the comments having the following words and our keyword list would contain "Binod" but I don’t have any comments with Binod so I will add some other words so that we get initial results.
let’s print the comments which have our defined keywords and see if we are getting the proper comments And after running we get the proper outputs.

Step - 06 Saving to file
Ok bro then kam toh hogaya hamara, track kar pa rahe hai hum but wait we need to save these comments so, I will save these comments to a file by the name Binod.txt and call this function from comments and you can see the comments in the file

Step - 07 Testing
So before testing, I Have properly printed the comments which we got with proper counting and we will not load all the comments as there are lakhs of comments so i have scraped approximately a thousand comments with around 20 loops
now let’s change the keywords with all words as Binod.
we will find a youtube video with lots of comments and change the URL. so this is what I was talking about if we scroll till the bottom we would have to wait for a day. so let’s test our script.

? Social Media ?
? LinkedIn: https://www.linkedin.com/in/adityamahajan123/
? Website: http://adityamahajan.ml/
? GitHub: https://github.com/skystone1000/
? Instagram: https://www.instagram.com/skystone1000/

⚡ Please leave a LIKE and SUBSCRIBE for more content! ⚡

⭐ Tags ⭐
- Binod
- Python
- Who is Binod?
- Web Scraping
- Where is Binod
- Independence from binod.
- Tracking Binod

⭐ Hashtags ⭐
#Binod #python #webscraping

Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Binod Tracker | Python selenium | Youtube Scraping» бесплатно и без регистрации, вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.

Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.

Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!

Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.