How to get text which has no HTML tag | Add multiple delimiters in split
问题 Following XPath select div element with class ajaxcourseindentfix and split it from Prerequisite and gives me all the content after prerequisite. div = soup.select("div.ajaxcourseindentfix")[0] " ".join([word for word in div.stripped_strings]).split("Prerequisite: ")[-1] My div can have not only prerequisite but also the following splitting points: Prerequisites Corerequisite Corerequisites Now, whenever I have Prerequisite , above XPath works fine but whenever anything from above three comes