title: AttributeError: 'list' object has no attribute 'text' - python
body: <p>In my code .text is working fine in 3rd line but giving </p>
  
  <blockquote>
    <p>AttributeError: 'list' object has no attribute 'text'` </p>
  </blockquote>
  
  <p>error for last line. Both are same but what might be the problem?</p>
  
  <pre><code>for elem6 in doc.findall('.//medicationsInfo/entryInfo'):   
         drugcodeSystem.append(elem6.find('productCode/codeSystem'))
         drugname.append(elem6.find('productCode/displayName').text)  
         routecode.append(elem6.find('routeCode/code'))   
         routecodeSystem.append(elem6.find('routeCode/codeSystem'))   
         drugname1.append(elem6.find('productCode/codeSystemName').text)
  </code></pre>