なぜこの作品
for td in alltd:
if "style3" in td["class"] or "style4" in td["class"] or "style1" in td["class"]:
td["class"] = "s1"
そして、これはありませんか?
for td in alltd:
if all(x in td["class"] for x in ("style3", "style4", "style1")):
td["class"] = "s1"