Skip to content

Instantly share code, notes, and snippets.

@firemonk9
Created February 24, 2020 18:42
Show Gist options
  • Save firemonk9/35778d2794c6b6f56bd6dbaece8c668f to your computer and use it in GitHub Desktop.
Save firemonk9/35778d2794c6b6f56bd6dbaece8c668f to your computer and use it in GitHub Desktop.
Scrap Share point documents from Chrome browser
import subprocess
vval='"c:\Program Files (x86)\Google\Chrome\Application\chrome.exe" <URL>'
def run_win_cmd(cmd):
result = []
process = subprocess.Popen(cmd,
shell=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE)
for line in process.stdout:
result.append(line)
errcode = process.returncode
for line in result:
print(line)
if errcode is not None:
print('exeption in %s cmd ',cmd)#raise Exception('cmd %s failed, see above for details', cmd)
for i in range(1000,2300):
my_str = vval.replace('IIDDII',str(i))
run_win_cmd(my_str)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment