Forum Discussion
Notebooks
What is the syntax for setting up a notebook to ingest data from an online excel file using the download url?
4 Replies
- GilbertQSuper User
Hi User_212
I would recommend doing a search to find the exact syntax for downloading an Excel file.
Here is an example I got from ChatGTP
from office365.sharepoint.client_context import ClientContext from office365.runtime.auth.client_credential import ClientCredential from office365.runtime.auth.user_credential import UserCredential # Define your SharePoint site and file details site_url = "https://yourcompany.sharepoint.com/sites/yoursite" file_url = "/sites/yoursite/Shared Documents/yourfile.xlsx" # The relative URL of the file in the document library # Authentication details username = "[email protected]" password = "your_password" # Create a ClientContext object ctx = ClientContext(site_url).with_credentials(UserCredential(username, password)) # Download the file response = ctx.web.get_file_by_server_relative_url(file_url).download("./downloaded_file.xlsx").execute_query() print("File has been downloaded successfully")- User_212New Member
Thanks for your response, however its not a sharepoint file I am attempting to ingest its just some company data from an online source in excel format. I've tried ChatGPT but not having any luck unfortunately.
- AnonymousNot applicable
thanks for your concern about this issue.And I would like to share some additional solutions below.
I am glad to help you.Has your problem been solved?
I'm sorry I couldn't find a script statement for importing online Excel data at the moment, but I hope the following suggestions will help youIf you need to extract data from the web and import it into OneNote, you could try using the following plugin
If you are using Chrome (newer versions of Edge are also available in the plugin store), add the plugins: "OneNote Web Clipper for Chrome" /"OneNote Web Clipper for Edge"
URL:OneNote Web Clipper - Microsoft Edge AddonsThis plug-in can save the content of the current web page in four forms to your OneNote account, respectively: the whole page to save (all the content of the web page, including ads, etc.), area to save (screenshots), articles (only the body part), bookmarks (web page overview and URL). The one I use most often is Articles, which saves the necessary.
information and doesn't save the extra information.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi,User_212
Have you solved your problem?
If you have found a suitable solution, please share it as it will help more users with similar problems!I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.