python - How to find lists after a specific word -


I am trying to find all the lists after those words, which I want to do in categories according to that word .

So my sample data is as follows:

  & lt; P & gt; & Lt; A href = "#" & gt; Word A & lt; / A & gt; & Lt; / P & gt; & Lt; Ul & gt; & Lt; Li & gt; Some & lt; / Li & gt; & Lt; Li & gt; Some & lt; / Li & gt; & Lt; Ul & gt; & Lt; P & gt; & Lt; A href = "#" & gt; Word & lt; / A & gt; & Lt; / P & gt; & Lt; Ul & gt; & Lt; Li & gt; Some & lt; / Li & gt; & Lt; Li & gt; Some & lt; / Li & gt; & Lt; Ul & gt;  

Keeping the above example in mind, I want Tiwari Fetch Word A and the categories that are in the list below, and for this WordB .

Is it possible to search for WordA and below & lt; Ul & gt; Find tags

Changing all the links in the paragraph, parent for each link Get the ul tag to the next person and get all Li inside the tag (helps to get the next ul element after the article)

BeautifulSoup html = "" "

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -