title: How to remove duplicate values from a beautiful soup result set whilst preserving order?
body: <p>I have a scenario where I am searching through values in a beautiful soup result set and treating them differently depending on their contents, eg:</p>
  
  <pre><code>for i in bs_result_set:
      if 'this unique string' in i.text:
          print 'aaaa'
      else:
          print 'bbbb'
  </code></pre>
  
  <p>However I have realised that the unique condition actually occurs twice in the result set however I do not need that second replicate value and therefore want to remove it from the result set in the first place.  </p>
  
  <p>I have tried approaches to removing duplicate values in a <code>list</code> (whilst preserving order) but these do not seem to work on an object that is a beautiful soup result set.  Eg i used logic from <a href="https://stackoverflow.com/a/11541660">this post</a> to try:</p>
  
  <pre><code>from collections import OrderedDict 
  OrderedDict.fromkeys(bs_result_set).keys()
  </code></pre>
  
  <p>But that didn't seem to remove the duplicate values.  </p>
  
  <p>So my question is how do i remove duplicate values from a beautiful soup result set whilst preserving order?</p>