title: How to Preserve Order in Beautifulsoup?
body: <p>I'm using Beautifulsoup Soap to extract visible text in webpage, so I tried to implement the following solution:</p>
  <pre><code>def filter_visible_texts(element):
      if element.parent.name in ['style', 'script', 'head', 'title', 'meta', '[document]']:
          return False
      if isinstance(element, Comment):
          return False
      return True
  
  
  def extract_visible_text(soup):
      visible_texts = soup.find_all(text=True)
      print(visible_texts)
      filtered_visible_texts = filter(filter_visible_texts, visible_texts)
      return set(text.strip() for text in filtered_visible_texts)
  </code></pre>
  <p>The problem is that it's critical to me to preserve order.</p>
  <p>The documentation of Beautifulsoup doesn't say anything regarding optional parameter to preserve order. Isn't this possible?</p>