I've tried many methods from similar questions and can't get anything to return the video URL's.
Using Chrome DevTools, the a links with hrefs for video urls are clearly in there, but when I try to return anything with an href in the format of a video url, nothing appears.
from bs4 import BeautifulSoup as bs
import requests
def getlinks(url):
r = requests.get(url)
soup = bs(r.content, features='lxml')
for link in soup.find_all("a"):
href = link.get('href')
if href.startswith('/watch?'):
print(href)
getlinks('https://www.youtube.com/playlist?list=PLU6BYY1Lu_feVbuZEscpd6xT32zCrVrev')