title: How can I execute a Javascript function from VBScript?
body: <p>I'm trying to download an Excel file from a webpage by using WSH scripts</p>
  
  <p>My objective is to save the Excel file from a webpage onto my machine.</p>
  
  <p>So far, the steps I've taken are: Made a vbs file, which logs into the https webpage, redirects me to another page using the second run command that opens up a new tab but after that my limited knowledge isn't able to find a solution as to how to download the file from the download link on the website to a location on my hard drive. </p>
  
  <pre><code>Dim wshShell
  Set wshShell = CreateObject("WScript.Shell")
  WshShell.Run "URL", 9
  wscript.sleep 3000
  WshShell.SendKeys "username@"
  WshShell.SendKeys "{tab}"
  WshShell.SendKeys "password"
  WshShell.SendKeys "{enter}"
  WshShell.Run "Another_URL"
  </code></pre>
  
  <p>Now at this point there is a Download Link which has a javascript function <code>javascript:download(parameters)</code> which upon manual click generates a unique download link. </p>
  
  <p>Is there any way I can download this using any Wscript? I want it to work with Windows 7 and IE 7. I have tried looking into it but it is of no avail. </p>