title: Passing a string but getting byte attribute error to urllib.request.read
body: <p>I am trying to read an XML file from the Yahoo finance API. So far, I've tried the following:</p>
  
  <pre><code> from xml.dom.minidom import parse
   #Start Get Employees
          xml = urllib.request.urlopen('https://query.yahooapis.com/v1/public/yql?q=select%20*%20from%20yahoo.finance.stocks%20where%20symbol%3D%22wfc%22&amp;diagnostics=true&amp;env=store%3A%2F%2Fdatatables.org%2Falltableswithkeys')
          dom = parse(xml.read())
          numemployees = dom.getElementsByTagName('FullTimeEmployees')
          numemployees = name[0].firstChild.nodeValue
   #End Get Employees
  </code></pre>
  
  <p>However, this raises an exception:</p>
  
  <pre><code>AttributeError: 'bytes' object has no attribute 'read'
  </code></pre>
  
  <p>I think this is because if it doesn't recognize the string, it assumes I'm passing a byte pattern. However, I am passing a string so I don't know what the problem is here. </p>
  
  <p>Full Stack Trace:</p>
  
  <pre><code>Traceback (most recent call last):
    File "C:\Python34\lib\tkinter\__init__.py", line 1487, in __call__
      return self.func(*args)
    File "C:\Users\kylec\Desktop\dm\Mail Server Finder\mailserverfinder.py", line 25, in getServers
      dom = parse(xml.read())
    File "C:\Python34\lib\xml\dom\minidom.py", line 1960, in parse
      return expatbuilder.parse(file)
    File "C:\Python34\lib\xml\dom\expatbuilder.py", line 913, in parse
      result = builder.parseFile(file)
    File "C:\Python34\lib\xml\dom\expatbuilder.py", line 204, in parseFile
      buffer = file.read(16*1024)
  AttributeError: 'bytes' object has no attribute 'read'
  </code></pre>