beautifulsoup: find_all on bs4.element.ResultSet object or list?
<p>Hi so I apply find_all on a <code>beautifulsoup object</code>, and find something, which is an <code>bs4.element.ResultSet object</code> or a <code>list</code>.</p>

<p>I want to further do find_all in there, but it's not allowed on a  <code>bs4.element.ResultSet object</code>. I can loop through each element of the <code>bs4.element.ResultSet object</code> to do find_all. But can I avoid looping and just convert it back to a <code>beautifulsoup object</code>? </p>

<p>See code for details please. Thanks</p>

<pre><code>html_1 = """
&lt;table&gt;
    &lt;thead&gt;
        &lt;tr class="myClass"&gt;
            &lt;th&gt;A&lt;/th&gt;
            &lt;th&gt;B&lt;/th&gt;
            &lt;th&gt;C&lt;/th&gt;
            &lt;th&gt;D&lt;/th&gt;
        &lt;/tr&gt;
    &lt;/thead&gt;
&lt;/table&gt;
"""
soup = BeautifulSoup(html_1, 'html.parser')

type(soup) #bs4.BeautifulSoup

# do find_all on beautifulsoup object
th_all = soup.find_all('th')

# the result is of type bs4.element.ResultSet or similarly list
type(th_all) #bs4.element.ResultSet
type(th_all[0:1]) #list

# now I want to further do find_all
th_all.find_all(text='A') #not work

# can I avoid this need of loop?
for th in th_all:
    th.find_all(text='A') #works
</code></pre>