Skip to main content

A python package to webscraping for youtube video data as title, video url, thumbnail url, and number of views.

Project description

TubeScrapy

A python package to webscrap for youtube video data as title, video url, thumbnail url, and number of views. The package runs packages Selenium and Webdriver to access Youtube page and copy videos informations. The process is expensive and remains about 5 seconds for search. The first search could take a little more time because package Webdriver will download and install the web driver to control Chrome browser.

Python minimal version

  • Python 3.8

Python packages required

  • Selenium 4.8.2
  • Webdriver-manager 3.8.5

Examples

First of all, import module:

import tube_scrapy

Create a new instance of TubeScrapy:

ts = TubeScrapy()

Create a variable to save video info searched using method search_video_info():

videos_infos = ts.search_video_info(
    search_title = 'Cheia de Manias Raça Negra', # search title or query
    add_to_search = 'karaoke', # will basiclly be concatened with search_title
    search_range = 5 # quantity of videos searched
)

The videos informations will be returned in a list of objects ScrapedVideoInfo, which have this structure:

ScrapedVideoInfo(
    title = title,              # youtube video title
    video_url = video_url,      # youtube video url
    thumbnail_url= thumbnail,   # video thumbnail url
    views = views               # video number of views
)

This is it, good coding! ;-) For more information, visit the project repository and relate any issue, please.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tube_scrapy-1.0.0b3.tar.gz (5.9 kB view hashes)

Uploaded Source

Built Distribution

tube_scrapy-1.0.0b3-py3-none-any.whl (6.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page