The following is part of a website that I am trying to extract the video titles from:
</div>
<div class="yt-lockup-content">
<h3 class="yt-lockup-title">
<a class="yt-uix-sessionlink yt-uix-tile-link yt-uix-contextlink
yt-ui-ellipsis yt-ui-ellipsis-2"
dir="ltr"
title="Harder Polynomials"
data-sessionlink="ei=fYsHUvSLA8uzigLq74CABQ&ved=CB8Qvxs&feature=c4-videos-u"
href="/watch?v=LHvQeBRLFn8"
>
Harder Polynomials
</a>
I wish to extract the video title (Harder Polynomials) from this. I have tried the following code:
import requests
from bs4 import BeutifulSoup
resp=requests.get('http://www.youtube.com/user/sachinabey/videos')
a=soup.findAll('a', attrs={'class': 'yt-uix-sessionlink yt-uix-tile-link yt-uix- contextlink yt-ui-ellipsis yt-ui-ellipsis-2'})
a is empty, what am I doing wrong. From here how do I extract the title