#------------------------------------------------------------------------------ # find the first BeautifulSoup.NavigableString from soup contents def findFirstNavigableString(soupContents): firstString = None; for eachContent in soupContents: # note here must import NavigableString from BeautifulSoup if(isinstance(eachContent, NavigableString)): firstString = eachContent; break; return firstString;