Today we are going to talk about Automating things around you using python.
So, I guess most of you are already familiar with python if not this is a time to learn something new. Today we will talk more about how we can make our life easy with python, We will learn about automating things.
What exactly is automation and what I’m talking about?
Automation simply means making something do itself like you have a job to rename 100 files in a folder why do it yourself let computer help you [Here is the code for same].
Why python for automation?
Python is a scripting language, and scripting languages that mean it need not get compiled and can be run on any system.
Python is open-source, very simple and has some great library’s that you can use to make your program easily.
Ok, Let’s Do Some Coding….
Today we will build a python script which can play youtube video on your browser if you pass a video title isn’t it cool?
Let’s get started….
Step1: We need a youtube link (link to the video we want to play in browser):
Let’s search for something on youtube
nape we can do this from a url
We just need to extract link of the first video
from bs4 import BeautifulSoup
soup = BeautifulSoup(page.text, "lxml")
return ('https://www.youtube.com' + links['href'])
This will get the link of the Video now we just need to play that on the browser I would say you should try to do that yourself for help let me tell you there is a library that can help you webbrowser .
There is already a library that does the same and was publishes by me here . Hope you like and enjoy this tutorial.
Questions? Ask in comments below 🙂