Downloading Excel File from a URL and using the data
How to download an excel file from the sharepoint url
Link excel cell to downloadable document
Download an excel from a website
Videos
I suggest using requests:
import requests
dls = "http://www.muellerindustries.com/uploads/pdf/UW SPD0114.xls"
resp = requests.get(dls)
output = open('test.xls', 'wb')
output.write(resp.content)
output.close()
To get requests installed:
pip install requests
To add on to Fedalto's requests suggestion (+1), but make it more Pythonic with a context manager:
import requests
dls = "http://www.muellerindustries.com/uploads/pdf/UW SPD0114.xls"
resp = requests.get(dls)
with open('test.xls', 'wb') as output:
output.write(resp.content)
You can use simple html links:
link:
<a href='/path/to/excel/file.xls' target="_blank">Download</a>
button:
<form>
<input type="button" value="Download" onClick="window.location.href='/path/to/excel/file.xls'">
</form>
How about just referring to the file through an anchor?
<a href="path-to-file.xls">Download</a>
I have an online excel file that my whole team uses. My boss sent us a link to it and everyone can edit the document at the exact same time. I can even see when other people are on it and what box they have selected.
Every time I want to open it I have to dig through my email to find it then click the link. How can I save it to my desktop so that I can double click it and it will open in excel (not my browser)? I have tried to just save it to my desktop like any other file but it saves an offline version that no one else can edit.
Thanks to finding out OneDrive for Business is actually a re-branded Sharepoint 2013 and an answer in Sharepoint@SE I managed to get a link for programmatic download of a document.
One way to achieve is to right click on the document in the web GUI and take the URL there. It didn't work for me as this URL required authentication, but...
Taking the prefix of the URL e.g.
https://acmeacme.sharepoint.com/personal/myname/_layouts/15/download.aspx?SourceUrl=
and the "usual" URL generated as guest link
https://acmacme.sharepoint.com/personal/myname/_layouts/15/guestaccess.aspx?guestaccesstoken=123123%3d&docid=123123
and concatenating them turned out to work like a charm:
wget https://acmeacme.sharepoint.com/personal/myname/_layouts/15/download.aspx?SourceUrl=https://acmacme.sharepoint.com/personal/myname/_layouts/15/guestaccess.aspx?guestaccesstoken=123123%3d&docid=12312
All I needed to do was change the Edit Link slightly. Just replace guestaccess.aspx with download.aspx.