parent= doc.find_all('td',{'class':'titleColumn'}) ranks = [] for item in parent:
ranks.append(item.parent.text) ranks
I have the following O/P from the code above to extract the td tags from the beautiful soup object 'doc' created for the top 250 movies on the IMDB.How do I extract only the no(ratings such as 1 2 3 ...) from the o/p lines below.If looping is needed to extract all the numbers, please let me know how it is to be done.
['\n\n\n\n\n\n\n \n \n\n 1.\n The Shawshank Redemption\n(1994)\n\n\n9.2\n\n\n\n\n\n\xa012345678910 \n\n\n\nNOT YET RELEASED\n \n\nSeen\n\n\n\n\n\n\n', '\n\n\n\n\n\n\n \n \n\n 2.\n The Godfather\n(1972)\n\n\n9.2\n\n\n\n\n\n\xa012345678910 \n\n\n\nNOT YET RELEASED\n \n\nSeen\n\n\n\n\n\n\n', '\n\n\n\n\n\n\n \n \n\n 3.\n The Dark Knight\n(2008)\n\n\n9.0\n\n\n\n\n\n\xa012345678910 \n\n\n\nNOT YET RELEASED\n \n\nSeen\n\n\n\n\n\n\n', '\n\n\n\n\n\n\n \n \n\n 4.\n The Godfather Part II\n(1974)\n\n\n9.0\n\n\n\n\n\n\xa012345678910 \n\n\n\nNOT YET REL