I want to remove the certain span elements, all up about 10 individual classes. I can do this tediously by repeating my code 10 times, but that is not a correct way to learn.
This is what I got working, that I want to simplify:
for span in table_tag.find_all("span", {'class':'class1'}):
span.decompose()
for span in table_tag.find_all("span", {'class':'class2'}):
span.decompose()
for span in table_tag.find_all("span", {'class':'class3'}):
span.decompose()
This is what I tried but it didn't remove anything:
remove = table_tag.find_all('class1','class2','class3')
for span in table_tag.find_all("span", {'class': remove}):
span.decompose()
The BeautifulSoup documentation just doesn't hit home with me about how to decompose multiple elements in one command. Also when I go above 5 classes in the find_all command, I get an error that find_all takes from 1 to 6 positional arguments but 7 were given. Obviously I am using the command wrong, just need some help, please.
Thanks in advance.