title: How to solve an attribute error when using beautifulsoup?
body: <p>I am reading in a .html file that looks similar to the following format:</p>
  
  <pre><code>html = '''
  &lt;tr&gt;
  &lt;td class="SmallFormText" colspan="3"&gt;hours per response:&lt;/td&gt;&lt;td class="SmallFormTextR"&gt;23.8&lt;/td&gt;
  &lt;/tr&gt;
  &lt;hr&gt;
  &lt;table width="100%" border="0" cellspacing="0" cellpadding="4" summary="Form 13F-NT Header Information"&gt;
  &lt;tbody&gt;
  &lt;tr&gt;
  &lt;td class="FormTextC"&gt;COLUMN 1&lt;/td&gt;&lt;td class="FormTextC"&gt;COLUMN 2&lt;/td&gt;&lt;td class="FormTextC"&gt;COLUMN 3&lt;/td&gt;&lt;td class="FormTextR"&gt;COLUMN 4&lt;/td&gt;&lt;td class="FormTextC" colspan="3"&gt;COLUMN 5&lt;/td&gt;&lt;td class="FormTextC"&gt;COLUMN 6&lt;/td&gt;&lt;td class="FormTextR"&gt;COLUMN 7&lt;/td&gt;&lt;td class="FormTextC" colspan="3"&gt;COLUMN 8&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class="FormText"&gt;&lt;/td&gt;&lt;td class="FormText"&gt;&lt;/td&gt;&lt;td class="FormText"&gt;&lt;/td&gt;&lt;td class="FormTextR"&gt;VALUE&lt;/td&gt;&lt;td class="FormTextR"&gt;SHRS OR&lt;/td&gt;&lt;td class="FormText"&gt;SH/&lt;/td&gt;&lt;td class="FormText"&gt;PUT/&lt;/td&gt;&lt;td class="FormText"&gt;INVESTMENT&lt;/td&gt;&lt;td class="FormTextR"&gt;OTHER&lt;/td&gt;&lt;td class="FormTextC" colspan="3"&gt;VOTING AUTHORITY&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class="FormText"&gt;NAME OF ISSUER&lt;/td&gt;&lt;td class="FormText"&gt;TITLE OF CLASS&lt;/td&gt;&lt;td class="FormText"&gt;CUSIP&lt;/td&gt;&lt;td class="FormTextR"&gt;(x$1000)&lt;/td&gt;&lt;td class="FormTextR"&gt;PRN AMT&lt;/td&gt;&lt;td class="FormText"&gt;PRN&lt;/td&gt;&lt;td class="FormText"&gt;CALL&lt;/td&gt;&lt;td class="FormText"&gt;DISCRETION&lt;/td&gt;&lt;td class="FormTextR"&gt;MANAGER&lt;/td&gt;&lt;td class="FormTextR"&gt;SOLE&lt;/td&gt;&lt;td class="FormTextR"&gt;SHARED&lt;/td&gt;&lt;td class="FormTextR"&gt;NONE&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class="FormData"&gt;1ST SOURCE CORP&lt;/td&gt;&lt;td class="FormData"&gt;COM&lt;/td&gt;&lt;td class="FormData"&gt;336901103&lt;/td&gt;&lt;td class="FormDataR"&gt;8&lt;/td&gt;&lt;td class="FormDataR"&gt;335&lt;/td&gt;&lt;td class="FormData"&gt;SH&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td class="FormData"&gt;SOLE&lt;/td&gt;&lt;td class="FormData"&gt;7&lt;/td&gt;&lt;td class="FormDataR"&gt;335&lt;/td&gt;&lt;td class="FormDataR"&gt;0&lt;/td&gt;&lt;td class="FormDataR"&gt;0&lt;/td&gt;
  &lt;/tr&gt;
  &lt;tr&gt;
  &lt;td class="FormData"&gt;1ST UNITED BANCORP INC FLA&lt;/td&gt;&lt;td class="FormData"&gt;COM&lt;/td&gt;&lt;td class="FormData"&gt;33740N105&lt;/td&gt;&lt;td class="FormDataR"&gt;7&lt;/td&gt;&lt;td class="FormDataR"&gt;989&lt;/td&gt;&lt;td class="FormData"&gt;SH&lt;/td&gt;&lt;td&gt;&amp;nbsp;&lt;/td&gt;&lt;td class="FormData"&gt;SOLE&lt;/td&gt;&lt;td class="FormData"&gt;7&lt;/td&gt;&lt;td class="FormDataR"&gt;989&lt;/td&gt;&lt;td class="FormDataR"&gt;0&lt;/td&gt;&lt;td class="FormDataR"&gt;0&lt;/td&gt;
  &lt;/tr&gt;    '''
  </code></pre>
  
  <p>In this code, I am trying to extract the information between the &lt; tr > and &lt; /tr > tags. In particular, I want to assign a given information, such as "NAME OF ISSUER" to a column name called "NAME_OF_ISSUER", using beautiful soup. However, when I run the following code, I am facing an error that looks simple to be solved (it's more or less a data formatting issue). Given that I am new to Python, I got stuck for a few hours trying alternative solutions. I would appreciate any comments or feedback. </p>
  
  <p>Here is my code (please run the above code as well to obtain the html data): </p>
  
  <pre><code>from bs4 import BeautifulSoup
  soup = BeautifulSoup(html, 'lxml')
  rows = soup.find_all('tr')[11:]
  positions = []
  dic = {}
  position = rows.find_all('td')
  dic["NAME_OF_ISSUER"] = position[0].text
  dic["CUSIP"] = position[2].text
  dic["VALUE"] = int(position[3].text.replace(',', ''))*1000
  dic["SHARES"] = int(position[4].text.replace(',', ''))
  positions.append(dic)
  df = pd.DataFrame(positions)
  </code></pre>
  
  <p>I am getting an "AttributeError" right after defining position, stating that the list object has no attribute "find_all". </p>
  
  <p>What exactly does this mean? Also, how would I need to transform the html data to avoid this issue? </p>
  
  <p>Edited part:</p>
  
  <p>Here is the full stack trace:</p>
  
  <pre><code>position = rows.find_all('td')
  Traceback (most recent call last):
  
    File "&lt;ipython-input-8-37353b5ab2ef&gt;", line 1, in &lt;module&gt;
      position = rows.find_all('td')
  
  AttributeError: 'list' object has no attribute 'find_all'
  </code></pre>