Saving tables from html document
<p>I tried to save tables from a document as a file under a directory as follows:</p>

<pre><code>for table in tables:
    tableString = html.tostring(table)
    fileref=open('c:\\Users\\ahn_133\\Desktop\\appleTables\\Apple-' + str(count) + '.htm', 'w')
    fileref.write(tableString)
    fileref.close()
    count+=1
</code></pre>

<p>But, I keep getting an error as follows:</p>

<pre><code>Traceback (most recent call last):
  File "&lt;pyshell#27&gt;", line 4, in &lt;module&gt;
    fileref.write(tableString)
TypeError: must be str, not bytes
</code></pre>

<p>I am using Python 3.3 and installed lxml-3.0.1.win32-py3.3.‌exe</p>

<p>How can I fix this error? </p>
