I have a long list of information scraped from the Billboard Hot 100 page which I am trying to distill into just songs and artists. However, I can't seem to remove all the empty parts as well as points in the list that are just blank spaces. '' and ' '
I have tried everything I can find on here with regards to the filter function as well as other options people have suggested. My initial attempt was using the included code, which worked for the first part of the list but for some reason never finishes and always stops part way.
for y in parse:
if y == "":
parse.remove("")
elif y == " ":
parse.remove(" ")
I would expect to be receiving a list with no '' or ' ' by themselves, but only the first part of the list is affected.