1.

Write a script in python, which scrapes video views, uploaded date, comments, like, dislikes from youtube for given video links. Write output in csv format.​

Answer»

Answer:

In this ARTICLE, we will learn how can we obtain data (like title, views, likes, dislikes etc) from any YouTube video using a Python script. For this task, we are going to use very famous LIBRARY for web scraping BeautifulSoup and Requests.

Modules REQUIRED and Installation :

Requests :

Requests allows you to send HTTP/1.1 requests extremely easily. There’s no NEED to manually add query strings to your URLs.

pip install requests

Beautiful Soup:

Beautiful Soup is a library that makes it easy to scrape information from web pages. It sits atop an HTML or XML parser, providing Pythonic idioms for iterating, searching, and MODIFYING the parse tree.

pip install beautifulsoup4



Discussion

No Comment Found