title: Going one element back BeautifulSoup
body: <p>I am trying to check if an element has another element containing a specific attribute (Such as <code>id=xxxxx</code>).</p>
  
  <p>This is roughly the structure:</p>
  
  <pre><code>&gt; &lt;div id=xxxx....
  &gt;&gt; &lt;div id=yyyy.... #
  &gt;&gt;&gt; &lt;div id=yyyy.... # All of those have the same attributes
  &gt;&gt; &lt;div id=yyyy.... #
  &gt;&gt; &lt;div id=yyyy.... #
  .....
  &gt; &lt;/div&gt;
  </code></pre>
  
  <p>I am able to find all yyyy. Is there a way I can traverse back and check if before the element with attribute <code>id=yyyy</code> there is an element with <code>id=xxxx</code>?</p>
  
  <p>If not, what is another solution I could adapt do do this?</p>