A tool that can download and upload files from SharePoint. Instead of using the Graph API, cleverly manipulate files using playwright. One time login, with subsequent unattended calls as a batch. If you're interested, come and take a look~
CSDN Blog homepage: [https://blog.csdn.net/qq_36991535?spm=1000.2115.3001.5343](https://blog.csdn.net/qq_36991535?spm=1000.2115.3001.5343)
Python: 3.8.5 OS: Windows 10
{
"chrome path": "C: Program Files Google Chrome Application chrome. exe", # Google ChromeExe file path
"user_data_dir":" user_data_dir ", # Browser cache directory, which can be a relative path or an absolute path
"always_show": false, # Control whether the browser is always displayed
"page_timeout": 30000, # Setting the timeout time for screen loading in ms
"login timeout": 300000, # Login timeout ms
"win_size": "800,600", # Browser window size setting
"win_posi": "0,0", # Browser location setting
"base_url": "https://fujitsu.sharepoint.com/teams/msteams_d54409", # Path for sharepoint
"login selector ":" #leftRegion ", # CSS selector for determining successful login
"login_url": "https://www.office.com/?auth=2, # Login address settings, with the Office365 homepage as the login address, or any product of any
Office365 as the login address
"max_retry_count": 5, # Maximum retry count configuration
"retry_interval": 5, # Configuration of retry interval s
"output_folder": "output", # specifying the output path
"proxy": "http://xxx.xxx.xxx.xxx:xxxx" # Proxy settings, specify null when no proxy is required
"spo_folder":"/Application of electronic contracts", # Sharepoint path for storing files
"filename": "20220330_1.PNG" # The file name in the sharepoint path
}
Python spo_file_download.py
Alternatively, you can start directly using parameter passing without using configuration, and note that only 'spo' is available_Folder and file_Name 'is a mandatory configuration
Priority command parameters>globalJSON configuration file
Example:
Python spo_file_download.py -- spo_folder="/Application of Electronic Contracts" --file_name="20220330_1. PNG"
pyinstaller - F spo_File_download.py
Execution method and 2. the same.
Playwright official website: [https://playwright.dev/python/docs/intro](https://playwright.dev/python/docs/intro)
Pyinstaller: [https://pypi.org/project/pyinstaller/](https://pypi.org/project/pyinstaller/)
The browser can cache user login information, and the next boot can be downloaded without logging in. It can be executed on a scheduled basis or batch called
Headless mode can be set, running in the background without affecting work
Customizable browser
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。