Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from selenium import webdriver
- import time
- import os
- FOLDER = "/home/furas/Pulpit/" # for some folders it needs / at the end
- #FOLDER = "D:/Download"
- options = webdriver.ChromeOptions()
- prefs = {"download.default_directory": FOLDER}
- options.add_experimental_option("prefs", prefs)
- driver = webdriver.Chrome(chrome_options=options)
- driver.get('https://github.com/ageitgey/face_recognition')
- button = driver.find_element_by_css_selector('summary.btn')
- button.click()
- dbutton = driver.find_element_by_css_selector('a.get-repo-btn')
- dbutton.click()
- time.sleep(0.5)
- while True:
- wait = False
- for i in os.listdir(FOLDER):
- if ".crdownload" in i:
- wait = True
- break # no need to check other files
- if not wait:
- break # exit `while True`
- print('wait')
- time.sleep(0.5)
- print("download complete")
Add Comment
Please, Sign In to add comment