With python, how can I connect to and download files from, a WebDAV server?
Question: My school has a webdav file server that contains files that I frequently need
to download. For this server, I have a username and password that I can use to
connect to the server, and If I go to the URL in chrome I can view everything
just fine. Now my question is, how can I access and login to this WebDAV
server with python, and then download files from it. I have been unable to
find anything with google and apologize if there was a very simple solution
that I missed.


Answer: You can use [python-webdav-library](https://launchpad.net/python-webdav-lib)

    
    
    from webdav import WebdavClient
    url = 'https://somesite.net'
    mydav = WebdavClient.CollectionStorer(url, validateResourceNames=False)
    mydav.connection.addBasicAuthorization(<username>, <password>)
    
    mydav.path = <path to file I want, ie '/a/b/c.txt'>
    mydav.downloadFile(<local path ie. ~/Downloads/c.txt>)
    

