Pax
Given `<p>Bananas <em>in</em> pyjamas are <em>going</em> down the <em>stairs</em>.</p>`
How can I get the HTML string inside the `<p>` tag?
That is, `Bananas <em>in</em> pyjamas are <em>going</em> down the <em>stairs</em>.`
```
paragraph = '<p>Bananas <em>in</em> pyjamas are <em>going</em> down the <em>stairs</em>.</p>'
paragraphTag = BeautifulSoup(paragraph, "html.parser")
# paragraphTag.???
```
Top Answer
Pax
It seems like there is no direct way to retrieve the string inside a tag.
`.text` and `.strings` will strip the tags.
`.contents` is our best bet but you have to cast to a string first.
```
return "".join(map(str, paragraphTag.contents))
```