title: Find all end-nodes that contain text using BeautifulSoup4
body: <p>I'm new to Python and BeautifulSoup4 </p>
  
  <p>I'm trying to extract (only) the textual content of all tags that are either 'div','p','li' and only from the immediate node, not the child nodes - hence the two options <code>text=True, recursive=False</code></p>
  
  <p>These are my attempts:</p>
  
  <pre><code>content = soup.find_all("b", "div", "p", text=True, recursive=False)
  </code></pre>
  
  <p>and </p>
  
  <pre><code>tags = ["div", "p", "li"]
  content = soup.find_all(tags, text=True, recursive=False)
  </code></pre>
  
  <p>Both of these give me no output, do you know what I'm doing wrong?</p>
  
  <p>EDIT - adding more code and a sample doc that I'm testing with, <code>print(content)</code> is empty</p>
  
  <pre><code>import requests
  from bs4 import BeautifulSoup
  
  url = "https://www.crummy.com/software/BeautifulSoup/bs4/doc/#a-list"
  response = requests.get(url, headers={'User-Agent': 'Mozilla/5.0'})
  
  soup = BeautifulSoup(response.text, "html.parser")
  
  tags = ["div", "p", "li"]
  content = soup.find_all(tags, text=True, recursive=False)
  
  print(content)
  </code></pre>