I am a little new to Python, and I am trying to understand how to extract the 'title='
attribute from this code (below). I have been trying to use beautifulsoup for it but honestly anything that will work is good for me.
<a class="image-link" href="/new-jersey/communities/holiday-city-at-berkeley" title="Holiday City at Berkeley"><div class="lazyload pulse out exited" style="height:auto"><div class="placeholder"><svg class="svg-placeholder-component" height="100%" viewbox="0 0 400 225" width="100%"><use xlink:href="#lazyload-placeholder"></use></svg></div></div></a>
I have tried all[0].find_all('a', "title")
and all[0].find_all("title")
, with both returning '[]'
.
<a class="image-link" href="/new-jersey/communities/holiday-city-at-berkeley" title="Holiday City at Berkeley"><div class="lazyload pulse out exited" style="height:auto"><div class="placeholder"><svg class="svg-placeholder-component" height="100%" viewbox="0 0 400 225" width="100%"><use xlink:href="#lazyload-placeholder"></use></svg></div></div></a>