How can I find one tag between two other tags?
<p>I have a document with structure like this:</p>

<pre><code>&lt;tag1&gt;some_text_1&lt;/tag1&gt;
&lt;tag2&gt;text_1&lt;/tag2&gt;
&lt;tag3&gt;....&lt;/tag3&gt;
&lt;tag2&gt;text_2&lt;/tag2&gt;
&lt;tag1&gt;some_text_2&lt;/tag1&gt;
&lt;tag2&gt;text_3&lt;/tag2&gt;
...
</code></pre>

<p>And I need to get all <code>tag2</code> instances that are after <code>tag1</code> with <code>some_text_1</code> and before the next <code>tag1</code>.</p>

<p>You should explain better what you need to find because is hard understand exactly what you want.</p>

<p>A good way to do it is using a regular expressions.</p>

<p><strong>Re Library Documentation:</strong>
    <a href="https://docs.python.org/2/library/re.html" rel="nofollow">https://docs.python.org/2/library/re.html</a></p>

python python-3.x beautifulsoup