title: Read xlsx stored on sharepoint location with openpyxl in python?
body: <p>quick one. </p>
  
  <p>I have XLSX file located on sharepoint drive and cannot open it using openpyxl in python, it works well if it is stored on my local drive. </p>
  
  <p>I tried this.</p>
  
  <pre><code>from openpyxl import load_workbook
  wb = load_workbook('https://content.potatocompany.com/workspaces/PotatoTeam/Shared Documents/XYZ errors/XYZ Errors_Confirm.xlsx')
  </code></pre>
  
  <p>Throws up this exception:</p>
  
  <pre><code>C:\Anaconda\lib\site-packages\openpyxl\reader\excel.py in load_workbook(filename, use_iterators, keep_vba, guess_types, data_only)
      123     except (BadZipfile, RuntimeError, IOError, ValueError):
      124         e = exc_info()[1]
  --&gt; 125         raise InvalidFileException(unicode(e))
      126     wb = Workbook(guess_types=guess_types, data_only=data_only)
      127 
  
  InvalidFileException: [Errno 22] invalid mode ('rb') or filename: 'https://...
  </code></pre>
  
  <p>Am I missing something?
  I need to read the content of one of the sheets in python. </p>
  
  <hr>
  
  <p>EDIT:</p>
  
  <p>Using crussell's advice, I receive <strong>401 UNAUTHORIZED</strong>:</p>
  
  <pre><code>import requests
  import urllib
  from openpyxl import load_workbook
  from requests.auth import HTTPBasicAuth
  
  file = "https://content.potatocompany.com/workspaces/PotatoTeam/Shared Documents/XYZ errors/XYZ Errors_Confirm.xlsx"
  
  username = 'PotatoUser'
  password = 'PotatoPassword'
  
  resp=requests.get(file, auth=HTTPBasicAuth(username, password))
  print(resp.content)
  </code></pre>
  
  <p>Seems like sharepoint and requests are not compatible, with both Digest Authentication and Basic Authentication
  <a href="http://docs.python-requests.org/en/latest/user/authentication/" rel="noreferrer">http://docs.python-requests.org/en/latest/user/authentication/</a></p>