I am trying to extract a NavigableString object from html.
The idea is to be able to further manipulate it with string.replace_with("new string")
In the following example everything works finefrom bs4 import BeautifulSoup
However if html code itself contains line breaks, then NavigableString is not extracted, instead a None is returnedfrom bs4 import BeautifulSoup
So, the question is how to extract a NavigableString, if html code contains line breaks. I know that get_text(strip=True) will work, but it will return just a text, not a NavigableString, so I will not be able to further manipulate it.