Skip to content

Instantly share code, notes, and snippets.

View lorey's full-sized avatar
shipping

Karl Lorey lorey

shipping
View GitHub Profile
@lorey
lorey / firefox-profile-with-automatic-download.py
Created April 1, 2017 10:05
Selenium: Prevent download dialog and download file automatically
# adapted from http://stackoverflow.com/a/25251803
profile = webdriver.FirefoxProfile()
profile.set_preference('browser.download.folderList', 2) # custom location
profile.set_preference('browser.download.manager.showWhenStarting', False)
profile.set_preference('browser.helperApps.neverAsk.saveToDisk', 'text/vcard') # type of file to download
# use the out folder of the script path
profile.set_preference('browser.download.dir', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'out'))
#!/bin/bash
mkdir -p ./rs/
for semester in $(seq -f "%02g" 4 15); do
wget -O ./rs/20${semester}_SS_aufgaben.pdf --user "rs" --password "rechner.strukturen" https://capp.itec.kit.edu/teaching/rs/ss${semester}/kl/aufgaben.pdf ;
wget -O ./rs/20${semester}_WS_aufgaben.pdf --user "rs" --password "rechner.strukturen" https://capp.itec.kit.edu/teaching/rs/ws${semester}/kl/aufgaben.pdf ;
wget -O ./rs/20${semester}_SS_loesung.pdf --user "rs" --password "rechner.strukturen" https://capp.itec.kit.edu/teaching/rs/ss${semester}/kl/loesung.pdf ;
wget -O ./rs/20${semester}_WS_loesung.pdf --user "rs" --password "rechner.strukturen" https://capp.itec.kit.edu/teaching/rs/ws${semester}/kl/loesung.pdf ;
done