title: Reading Local HTML File in Python
body: <p>I've been reviewing examples of how to read in HTML from websites using XPass and lxml. For some reason when I try with a local file I keep running into this error.</p>
  
  <pre><code>AttributeError: 'str' object has no attribute 'content'
  </code></pre>
  
  <p>This is the code</p>
  
  <pre><code>with open(r'H:\Python\Project\File','r') as f:
      file = f.read()
  f.close()
  
  tree = html.fromstring(file.content)
  </code></pre>