I'm trying to scrape a page using BeatifulSoup
import urllib2
from bs4 import BeautifulSoup
url='http://www.xpn.org/playlists/xpn-playlist'
page = urllib2.urlopen(url)
soup = BeautifulSoup(page.read())
for link in soup.find_all("li", class_="song"):
print link
The problem is the text I would like to return is not enclosed in it's own html tag
<li class="song"> <a href="/default.htm" onclick="return clickreturnvalue()
" onmouseout="delayhidemenu()" onmouseover="dropdownmenu(this, event, menu1,
'100px','Death Vessel','Mandan Dink','Stay Close')">Buy</a>
Chuck Ragan - Rotterdam - Folkadelphia Session</li>
What I want to return
Chuck Ragan - Rotterdam - Folkadelphia Session
Bonus Points: The data returned is of the format Artist/Song/Album. What would be the proper data structure to use to store and manipulate this info?