title: Python: AttributeError: 'str' object has no attribute 'font'
body: <p>I am using the following code to write to an excel file. Please correct me.
  I am parsing an HTML page in this context. My aim is to find the table elements and write it into columns.</p>
  
  <pre><code>for row in table.findAll('tr', { "class" : "product-row" }):
  col = row.findAll('td')
  
  i=1
  Image = col[0].a.img['src']
  Name = col[1].a.text
  Width = col[3].text
  
  record = (Image,Name,Width)
  
  book = xlwt.Workbook(encoding="utf-8")
  sheet1 = book.add_sheet("Sheet 1")
  
  sheet1.write(i, Image, Name, Width)
  
  book.save("trial.xls")
  </code></pre>
  
  <p>It shows the following error:</p>
  
  <pre><code>---------------------------------------------------------------------------
  AttributeError                            Traceback (most recent call last)
  &lt;ipython-input-179-1d146cb8794d&gt; in &lt;module&gt;()
       14     sheet1 = book.add_sheet("Sheet 1")
       15 
  ---&gt; 16     sheet1.write(i, Image, Name, Width)
       17 
       18     book.save("trial.xls")
  
  C:\Users\Santosh\Anaconda3\lib\site-packages\xlwt\Worksheet.py in 
  write(self, r, c, label, style)
     1086            :class:`~xlwt.Style.XFStyle` object.
     1087         """
  -&gt; 1088         self.row(r).write(c, label, style)
     1089 
     1090     def write_rich_text(self, r, c, rich_text_list, 
  style=Style.default_style):
  
  C:\Users\Santosh\Anaconda3\lib\site-packages\xlwt\Row.py in write(self, col, 
  label, style)
      233 
      234     def write(self, col, label, style=Style.default_style):
  --&gt; 235         self.__adjust_height(style)
      236         self.__adjust_bound_col_idx(col)
      237         style_index = self.__parent_wb.add_style(style)
  
  C:\Users\Santosh\Anaconda3\lib\site-packages\xlwt\Row.py in 
  __adjust_height(self, style)
       63 
       64     def __adjust_height(self, style):
  ---&gt; 65         twips = style.font.height
       66         points = float(twips)/20.0
       67         # Cell height in pixels can be calcuted by following approx. 
  formula:
  
  AttributeError: 'str' object has no attribute 'font
  </code></pre>