Skip to content Skip to sidebar Skip to footer

How To Webscrape A Title?

I was wondering how to webscrape the title of the first video in an youtube-playlist ? what I have so far try'd: import urllib.request from bs4 import BeautifulSoup theurl = 'http

Solution 1:

I did the following:

all = (soup.findAll("span",{"class":"title"}))
for a in all:
    print(a.text)
    break

When I looked in the soup, I could see the playlist has class=title for each song in the list. The output is:

Ed Sheeran - Thinking Out Loud [Official Video]

Post a Comment for "How To Webscrape A Title?"