그래서 웹 사이트에서 파일을 다운로드하기 위해 Selenium을 사용하고 있습니다. 35 초 동안 wait 명령을 내 렸습니다. 어디에 배치됩니다 어디에 모든 파일이 올바른지 보여하지만 내 프로그램에서 매개 변수로 파일의 이름을 전달하고 난 항상 마지막에 .part 얻을 심지어 tho 파일을 완전히 다운로드 한 내 다운로드 폴더에 제대로 표시됩니다. 여기에 내 코드 여기.partevert를 얻는 중 python으로 Selenium webdriver를 사용하여 파일을 다운로드하십시오.
Binary= FirefoxBinary('/home/what/Desktop/firefox/firefox-bin')
profile = webdriver.FirefoxProfile()
profile.set_preference("browser.download.folderList", 2)
profile.set_preference("browser.download.manager.showWhenStarting", False)
profile.set_preference("browser.download.dir", '/home/jerad/Desktop/Build')
profile.set_preference("browser.helperApps.neverAsk.openFile", "application/octet-
stream")
profile.set_preference("browser.helperApps.neverAsk.saveToDisk", "application/x-gzip")
driver = webdriver.Firefox(firefox_profile=profile, firefox_binary=Binary)
driver.get("website")
driver.find_element_by_xpath("//a[contains(text(), 'DEVcrt.sp1')]").click()
working = "/home/what/Desktop/Build"
abspath = os.path.join(os.getcwd(), working)
for file1 in os.listdir(abspath):
abspath = os.path.join(working, file1)
os.path.isfile(abspath)
time.sleep(35)
print "fnshed downloading"
return abspath
는
j = GetUpdate()
u = jerad.Update()