The first thing you need to do is read the HTML and see how mySpace encodes the information within the web page. After that, just parse the content and extract the individual IDs. I don't think you'll get a more specific answer than that, as your question is very domain-dependant.