Coder Social home page Coder Social logo

youtube-scraper's Introduction

# Youtube Scraper

Scrape Youtube Page without an API key.

#to find html tags and use them to scrape data from bs4 import BeautifulSoup from selenium import webdriver from selenium.webdriver.chrome.options import Options

#to Convert a Python's list, dictionary or Numpy array to a Pandas data frame. import pandas as pd

#to Convert a Pandas data frame to Excel File. import openpyxl

#function to scroll from 0 position to end position def scroll_to_bottom(driver):

old_position = 0
new_position = None

while new_position != old_position:
    time.sleep(.5)

    # Get old scroll position
    old_position = driver.execute_script(
            ("return (window.pageYOffset !== undefined) ?"
             " window.pageYOffset : (document.documentElement ||"
             " document.body.parentNode || document.body);"))
    # Sleep and Scroll
    time.sleep(7)
    driver.execute_script((
            "var scrollingElement = (document.scrollingElement ||"
            " document.body);scrollingElement.scrollTop ="
            " scrollingElement.scrollHeight;"))
    # Get new position
    new_position = driver.execute_script(
            ("return (window.pageYOffset !== undefined) ?"
             " window.pageYOffset : (document.documentElement ||"
             " document.body.parentNode || document.body);"))

FOR PERSONAL USE ONLY: The Change Color Chrome Application is for non-commercial use only. You may not attempt to download.

Screenshots

Feel free to contribute to fix any problems, or to submit an issue!

youtube-scraper's People

Contributors

vaibhav-karnwal avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.