human
how to get the context of a search in BeautifulSoup?
assistant
Here is some code to get the context of a search by keyword 'My keywords' in beautifulsoup `soup`

k = soup.find(text=re.compile('My keywords')).parent.text

#Warning: this code generation is experimental. Please inspect the code for any bugs before executing.