forked from florentbr/SeleniumBasic
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDownloadFile(Firefox).vbs
More file actions
29 lines (22 loc) · 2.05 KB
/
DownloadFile(Firefox).vbs
File metadata and controls
29 lines (22 loc) · 2.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
' ---------------------------------------------------------------------------------------
' Set Firefox to automatically download files without popup to a target folder
' ---------------------------------------------------------------------------------------
Class Script
Dim driver
Sub Class_Initialize
folder = Replace(WScript.ScriptFullName, WScript.ScriptName, "") & "firefox_download"
Set driver = CreateObject("Selenium.FirefoxDriver")
driver.SetPreference "pdfjs.disabled", True
driver.SetPreference "browser.download.dir", folder
driver.SetPreference "browser.download.folderList", 2
driver.SetPreference "browser.helperApps.neverAsk.saveToDisk", "application/pdf"
driver.Get "http://static.mozilla.com"
driver.Get "/moco/en-US/pdf/mozilla_privacypolicy.pdf"
WScript.Echo "Click OK to close the browser"
End Sub
Sub Class_Terminate
driver.Quit
End Sub
End Class
Set s = New Script