I am working on a "recursive" project with BeautifulSoup in Python. I've read an official document and lots of questions but I still don't get it.
from bs4 import BeautifulSoup
s = "<div>C<p><strong>A</strong>B</p></div>"
soup = BeautifulSoup(s, 'html.parser')
print(soup.find("p", recursive=False))givesNone
Is it because we can't find anything any more outside of <div></div>?
print(soup.find("p").find(recursive=False))gives<strong>A</strong>
If what I thought in the first question was correct,
I guessed this would give <p>B</p> because we can't go into a deeper depth. But why does this start from <strong>? why not <p>?
Also, how can I extract <p>B</p>?