Build Your Own Bot to Extract Hidden Meta Tags from Any YouTube Video Pages

YouTube page has hidden meta tags which are not hidden to other webpages.

In this code block you will see how to create a python bot which can extract this hidden gem Meta tags.

This code is created using Python and Scrapy Framework all together.


import scrapy


class YoutubeSpider(scrapy.Spider):
    name = 'youtube'
    allowed_domains = ['youtube.com']
    start_urls = ['https://www.youtube.com/watch?v=afyH2treks0']

    def parse(self, response):
        tag = response.xpath("//meta[@name='keywords']/@content").get()
        yield {
            "tag": tag
        }

Popular posts from this blog

GOOGLEFINANCE attributes

Practice

Merge/join two or more video files using Python